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

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

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: Retain the order of firing 'beforeinput' before 'compositionupdate' Created 3 years, 12 months 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.push_back( 58 dataObject->m_itemList.push_back(
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::createFromPlainTextAndHTML(const String& plainText,
66 const String& htmlText) {
67 DataObject* dataObject = create();
68 dataObject->add(plainText, mimeTypeTextPlain);
69 dataObject->add(htmlText, mimeTypeTextHTML);
70 return dataObject;
71 }
72
65 DataObject* DataObject::createFromString(const String& data) { 73 DataObject* DataObject::createFromString(const String& data) {
66 DataObject* dataObject = create(); 74 DataObject* dataObject = create();
67 dataObject->add(data, mimeTypeTextPlain); 75 dataObject->add(data, mimeTypeTextPlain);
68 return dataObject; 76 return dataObject;
69 } 77 }
70 78
71 DataObject* DataObject::create() { 79 DataObject* DataObject::create() {
72 return new DataObject; 80 return new DataObject;
73 } 81 }
74 82
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 } 365 }
358 item.title = originalItem->title(); 366 item.title = originalItem->title();
359 item.baseURL = originalItem->baseURL(); 367 item.baseURL = originalItem->baseURL();
360 itemList[i] = item; 368 itemList[i] = item;
361 } 369 }
362 data.swapItems(itemList); 370 data.swapItems(itemList);
363 return data; 371 return data;
364 } 372 }
365 373
366 } // namespace blink 374 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698