* platform/ios/ClipboardIOS.mm:
(WebCore::ClipboardIOS::ClipboardIOS):
(WebCore::ClipboardIOS::hasData):
(WebCore::ClipboardIOS::clearData):
(WebCore::ClipboardIOS::clearAllData):
(WebCore::ClipboardIOS::getData):
(WebCore::ClipboardIOS::setData):
(WebCore::ClipboardIOS::types):
(WebCore::ClipboardIOS::writeRange):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::getStringSelection):
(WebCore::Pasteboard::writeSelection):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::writeImage):
(WebCore::Pasteboard::plainText):
(WebCore::documentFragmentWithRTF):
(WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
(WebCore::Pasteboard::documentFragment):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150166
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-05-15 David Kilzer <ddkilzer@apple.com>
+
+ BUILD FIX (r150140): Frame::editor() should return a reference for iOS, too
+
+ * platform/ios/ClipboardIOS.mm:
+ (WebCore::ClipboardIOS::ClipboardIOS):
+ (WebCore::ClipboardIOS::hasData):
+ (WebCore::ClipboardIOS::clearData):
+ (WebCore::ClipboardIOS::clearAllData):
+ (WebCore::ClipboardIOS::getData):
+ (WebCore::ClipboardIOS::setData):
+ (WebCore::ClipboardIOS::types):
+ (WebCore::ClipboardIOS::writeRange):
+ * platform/ios/PasteboardIOS.mm:
+ (WebCore::Pasteboard::getStringSelection):
+ (WebCore::Pasteboard::writeSelection):
+ (WebCore::Pasteboard::writePlainText):
+ (WebCore::Pasteboard::writeImage):
+ (WebCore::Pasteboard::plainText):
+ (WebCore::documentFragmentWithRTF):
+ (WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
+ (WebCore::Pasteboard::documentFragment):
+
2013-05-15 Anders Carlsson <andersca@apple.com>
Stop using the factory pattern in FileIconLoaderClient
: Clipboard(policy, clipboardType)
, m_frame(frame)
{
- m_changeCount = m_frame->editor()->client()->pasteboardChangeCount();
+ m_changeCount = m_frame->editor().client()->pasteboardChangeCount();
}
ClipboardIOS::~ClipboardIOS()
bool ClipboardIOS::hasData()
{
- return m_frame->editor()->client()->getPasteboardItemsCount() != 0;
+ return m_frame->editor().client()->getPasteboardItemsCount() != 0;
}
static String utiTypeFromCocoaType(NSString* type)
if (RetainPtr<NSString> cocoaType = cocoaTypeFromHTMLClipboardType(type)) {
RetainPtr<NSDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
[representations.get() setValue:0 forKey:cocoaType.get()];
- m_frame->editor()->client()->writeDataToPasteboard(representations.get());
+ m_frame->editor().client()->writeDataToPasteboard(representations.get());
}
}
return;
RetainPtr<NSDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
- m_frame->editor()->client()->writeDataToPasteboard(representations.get());
+ m_frame->editor().client()->writeDataToPasteboard(representations.get());
}
String ClipboardIOS::getData(const String& type) const
NSString *cocoaValue = nil;
// Grab the value off the pasteboard corresponding to the cocoaType.
- RetainPtr<NSArray> pasteboardItem = m_frame->editor()->client()->readDataFromPasteboard(cocoaType.get(), 0);
+ RetainPtr<NSArray> pasteboardItem = m_frame->editor().client()->readDataFromPasteboard(cocoaType.get(), 0);
if ([pasteboardItem.get() count] == 0)
return String();
// Enforce changeCount ourselves for security. We check after reading instead of before to be
// sure it doesn't change between our testing the change count and accessing the data.
- if (cocoaValue && m_changeCount == m_frame->editor()->client()->pasteboardChangeCount())
+ if (cocoaValue && m_changeCount == m_frame->editor().client()->pasteboardChangeCount())
return cocoaValue;
return String();
if ([cocoaType.get() isEqualToString:(NSString*)kUTTypeURL]) {
RetainPtr<NSURL> url = adoptNS([[NSURL alloc] initWithString:cocoaData]);
[representations.get() setValue:url.get() forKey:(NSString*)kUTTypeURL];
- m_frame->editor()->client()->writeDataToPasteboard(representations.get());
+ m_frame->editor().client()->writeDataToPasteboard(representations.get());
return true;
}
// Everything else we know of goes on the pboard as the original string
// we received as parameter.
[representations.get() setValue:cocoaData forKey:cocoaType.get()];
- m_frame->editor()->client()->writeDataToPasteboard(representations.get());
+ m_frame->editor().client()->writeDataToPasteboard(representations.get());
return true;
}
// Enforce changeCount ourselves for security. We check after reading instead of before to be
// sure it doesn't change between our testing the change count and accessing the data.
- if (m_changeCount != m_frame->editor()->client()->pasteboardChangeCount())
+ if (m_changeCount != m_frame->editor().client()->pasteboardChangeCount())
return ListHashSet<String>();
ListHashSet<String> result;
{
ASSERT(range);
ASSERT(frame);
- Pasteboard::generalPasteboard()->writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame);
+ Pasteboard::generalPasteboard()->writeSelection(range, frame->editor().smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame);
}
void ClipboardIOS::writePlainText(const String& text)
String Pasteboard::getStringSelection(Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard)
{
- String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText();
+ String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor().selectedTextForClipboard() : frame->editor().selectedText();
text.replace(noBreakSpace, ' ');
return text;
}
if (enclosingAnchor && comparePositions(firstPositionInOrBeforeNode(selectedRange->startPosition().anchorNode()), selectedRange->startPosition()) >= 0)
selectedRange->setStart(enclosingAnchor, 0, ec);
- frame->editor()->client()->didSetSelectionTypesForPasteboard();
+ frame->editor().client()->didSetSelectionTypesForPasteboard();
RetainPtr<NSDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
// Put plain string on the pasteboard.
[representations.get() setValue:getStringSelection(frame, shouldSerializeSelectedTextForClipboard) forKey:(NSString *)kUTTypeText];
- frame->editor()->client()->writeDataToPasteboard(representations.get());
+ frame->editor().client()->writeDataToPasteboard(representations.get());
}
void Pasteboard::writePlainText(const String& text, Frame *frame)
RetainPtr<NSDictionary> representations = adoptNS([[NSMutableDictionary alloc] init]);
[representations.get() setValue:text forKey:(NSString *)kUTTypeText];
- frame->editor()->client()->writeDataToPasteboard(representations.get());
+ frame->editor().client()->writeDataToPasteboard(representations.get());
}
void Pasteboard::writeImage(Node* node, Frame* frame)
[dictionary.get() setObject:imageData.get() forKey:(NSString *)uti.get()];
[dictionary.get() setObject:(NSString *)node->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(static_cast<HTMLElement*>(node)->getAttribute("src"))) forKey:(NSString *)kUTTypeURL];
}
- frame->editor()->client()->writeDataToPasteboard(dictionary.get());
+ frame->editor().client()->writeDataToPasteboard(dictionary.get());
}
void Pasteboard::writePlainText(const String&, SmartReplaceOption)
String Pasteboard::plainText(Frame* frame)
{
- RetainPtr<NSArray> pasteboardItem = frame->editor()->client()->readDataFromPasteboard((NSString *)kUTTypeText, 0);
+ RetainPtr<NSArray> pasteboardItem = frame->editor().client()->readDataFromPasteboard((NSString *)kUTTypeText, 0);
if ([pasteboardItem.get() count] == 0)
return String();
frame->page()->setDefersLoading(true);
Vector<RefPtr<ArchiveResource> > resources;
- RefPtr<DocumentFragment> fragment = frame->editor()->client()->documentFragmentFromAttributedString(string.get(), resources);
+ RefPtr<DocumentFragment> fragment = frame->editor().client()->documentFragmentFromAttributedString(string.get(), resources);
size_t size = resources.size();
if (size) {
PassRefPtr<DocumentFragment> Pasteboard::documentFragmentForPasteboardItemAtIndex(Frame* frame, int index, bool allowPlainText, bool& chosePlainText)
{
- RefPtr<DocumentFragment> fragment = frame->editor()->client()->documentFragmentFromDelegate(index);
+ RefPtr<DocumentFragment> fragment = frame->editor().client()->documentFragmentFromDelegate(index);
if (fragment)
return fragment.release();
// First try to ask the client about the supported types. It will return null if the client
// has no selection.
- NSArray *supportedTypes = frame->editor()->client()->supportedPasteboardTypesForCurrentSelection();
+ NSArray *supportedTypes = frame->editor().client()->supportedPasteboardTypesForCurrentSelection();
if (!supportedTypes)
supportedTypes = supportedPasteboardTypes();
int numberOfTypes = [supportedTypes count];
for (int i = 0; i < numberOfTypes; i++) {
NSString *type = [supportedTypes objectAtIndex:i];
- RetainPtr<NSArray> pasteboardItem = frame->editor()->client()->readDataFromPasteboard(type, index);
+ RetainPtr<NSArray> pasteboardItem = frame->editor().client()->readDataFromPasteboard(type, index);
if ([pasteboardItem.get() count] == 0)
continue;
}
NSURL *url = (NSURL *)value;
- if (!frame->editor()->client()->hasRichlyEditableSelection()) {
+ if (!frame->editor().client()->hasRichlyEditableSelection()) {
fragment = createFragmentFromText(frame->selection()->toNormalizedRange().get(), [url absoluteString]);
if (fragment)
return fragment.release();
if (!frame)
return 0;
- int numberOfItems = frame->editor()->client()->getPasteboardItemsCount();
+ int numberOfItems = frame->editor().client()->getPasteboardItemsCount();
if (!numberOfItems)
return 0;