Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: third_party/WebKit/Source/core/clipboard/DataObject.cpp

Issue 2457523003: Support 'insertReplacementText' for spellcheck (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2008, 2009, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 for (const WebString& type : webTypes) { 55 for (const WebString& type : webTypes) {
56 if (pasteMode == PlainTextOnly && type != mimeTypeTextPlain) 56 if (pasteMode == PlainTextOnly && type != mimeTypeTextPlain)
57 continue; 57 continue;
58 dataObject->m_itemList.append( 58 dataObject->m_itemList.append(
59 DataObjectItem::createFromPasteboard(type, sequenceNumber)); 59 DataObjectItem::createFromPasteboard(type, sequenceNumber));
60 ASSERT(typesSeen.add(type).isNewEntry); 60 ASSERT(typesSeen.add(type).isNewEntry);
61 } 61 }
62 return dataObject; 62 return dataObject;
63 } 63 }
64 64
65 DataObject* DataObject::createFromString(const String& data) {
66 DataObject* dataObject = create();
67 dataObject->add(data, "text/plain");
chongz 2016/10/27 16:41:24 Can we import |mimeTypeTextPlain| from "ClipboardM
chaopeng 2016/10/28 00:33:08 Do we have any better head file? Cause this is not
chongz 2016/10/28 02:12:16 Will see if yosin@ has some suggestions.
68 return dataObject;
69 }
70
65 DataObject* DataObject::create() { 71 DataObject* DataObject::create() {
66 return new DataObject; 72 return new DataObject;
67 } 73 }
68 74
69 DataObject::~DataObject() {} 75 DataObject::~DataObject() {}
70 76
71 size_t DataObject::length() const { 77 size_t DataObject::length() const {
72 return m_itemList.size(); 78 return m_itemList.size();
73 } 79 }
74 80
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 336 }
331 item.title = originalItem->title(); 337 item.title = originalItem->title();
332 item.baseURL = originalItem->baseURL(); 338 item.baseURL = originalItem->baseURL();
333 itemList[i] = item; 339 itemList[i] = item;
334 } 340 }
335 data.swapItems(itemList); 341 data.swapItems(itemList);
336 return data; 342 return data;
337 } 343 }
338 344
339 } // namespace blink 345 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698