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

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

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: xiaocheng's review 2: Remove unrelated changes and added more checks Created 4 years 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 return cleanType; 109 return cleanType;
110 } 110 }
111 111
112 DataTransfer* DataTransfer::create(DataTransferType type, 112 DataTransfer* DataTransfer::create(DataTransferType type,
113 DataTransferAccessPolicy policy, 113 DataTransferAccessPolicy policy,
114 DataObject* dataObject) { 114 DataObject* dataObject) {
115 return new DataTransfer(type, policy, dataObject); 115 return new DataTransfer(type, policy, dataObject);
116 } 116 }
117 117
118 DataTransfer* DataTransfer::createForInputEvent(const String& plainText,
119 const String& htmlText) {
120 return new DataTransfer(
121 InputEvent, DataTransferReadable,
Xiaocheng 2016/12/22 06:26:20 Hmm... This is a behavior change. We were creatin
chongz 2016/12/22 19:32:26 Sorry for the confusion, there is actually no beha
122 DataObject::createFromPlainTextAndHTML(plainText, htmlText));
123 }
124
118 DataTransfer::~DataTransfer() {} 125 DataTransfer::~DataTransfer() {}
119 126
120 void DataTransfer::setDropEffect(const String& effect) { 127 void DataTransfer::setDropEffect(const String& effect) {
121 if (!isForDragAndDrop()) 128 if (!isForDragAndDrop())
122 return; 129 return;
123 130
124 // The attribute must ignore any attempts to set it to a value other than 131 // The attribute must ignore any attempts to set it to a value other than
125 // none, copy, link, and move. 132 // none, copy, link, and move.
126 if (effect != "none" && effect != "copy" && effect != "link" && 133 if (effect != "none" && effect != "copy" && effect != "link" &&
127 effect != "move") 134 effect != "move")
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 514 }
508 } 515 }
509 516
510 DEFINE_TRACE(DataTransfer) { 517 DEFINE_TRACE(DataTransfer) {
511 visitor->trace(m_dataObject); 518 visitor->trace(m_dataObject);
512 visitor->trace(m_dragImage); 519 visitor->trace(m_dragImage);
513 visitor->trace(m_dragImageElement); 520 visitor->trace(m_dragImageElement);
514 } 521 }
515 522
516 } // namespace blink 523 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698