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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

Issue 1799253002: Stricter user gestures for touch - measure and warn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweaks Created 4 years, 8 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2009 Igalia S.L. 4 * Copyright (C) 2009 Igalia S.L.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 static bool executeBackColor(LocalFrame& frame, Event*, EditorCommandSource sour ce, const String& value) 294 static bool executeBackColor(LocalFrame& frame, Event*, EditorCommandSource sour ce, const String& value)
295 { 295 {
296 return executeApplyStyle(frame, source, EditActionSetBackgroundColor, CSSPro pertyBackgroundColor, value); 296 return executeApplyStyle(frame, source, EditActionSetBackgroundColor, CSSPro pertyBackgroundColor, value);
297 } 297 }
298 298
299 static bool canWriteClipboard(LocalFrame& frame, EditorCommandSource source) 299 static bool canWriteClipboard(LocalFrame& frame, EditorCommandSource source)
300 { 300 {
301 if (source == CommandFromMenuOrKeyBinding) 301 if (source == CommandFromMenuOrKeyBinding)
302 return true; 302 return true;
303 Settings* settings = frame.settings(); 303 Settings* settings = frame.settings();
304 bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) | | UserGestureIndicator::processingUserGesture(); 304 bool defaultValue = (settings && settings->javaScriptCanAccessClipboard()) | | UserGestureIndicator::utilizeUserGesture();
305 return frame.editor().client().canCopyCut(&frame, defaultValue); 305 return frame.editor().client().canCopyCut(&frame, defaultValue);
306 } 306 }
307 307
308 static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource source, c onst String&) 308 static bool executeCopy(LocalFrame& frame, Event*, EditorCommandSource source, c onst String&)
309 { 309 {
310 // To support |allowExecutionWhenDisabled|, we need to check clipboard 310 // To support |allowExecutionWhenDisabled|, we need to check clipboard
311 // accessibility here rather than |Editor::Command::execute()|. 311 // accessibility here rather than |Editor::Command::execute()|.
312 // TODO(yosin) We should move checking |canWriteClipboard()| to 312 // TODO(yosin) We should move checking |canWriteClipboard()| to
313 // |Editor::Command::execute()| with introducing appropriate predicate, e.g. 313 // |Editor::Command::execute()| with introducing appropriate predicate, e.g.
314 // |canExecute()|. See also "Cut", and "Paste" command. 314 // |canExecute()|. See also "Cut", and "Paste" command.
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
1831 { 1831 {
1832 return m_command && m_command->isTextInsertion; 1832 return m_command && m_command->isTextInsertion;
1833 } 1833 }
1834 1834
1835 int Editor::Command::idForHistogram() const 1835 int Editor::Command::idForHistogram() const
1836 { 1836 {
1837 return isSupported() ? m_command->idForUserMetrics : 0; 1837 return isSupported() ? m_command->idForUserMetrics : 0;
1838 } 1838 }
1839 1839
1840 } // namespace blink 1840 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Fullscreen.cpp ('k') | third_party/WebKit/Source/core/frame/Deprecation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698