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

Side by Side Diff: third_party/WebKit/Source/web/ContextMenuClientImpl.cpp

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: fix rebase Created 3 years, 6 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) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 bool ContextMenuClientImpl::ShouldShowContextMenuFromTouch( 192 bool ContextMenuClientImpl::ShouldShowContextMenuFromTouch(
193 const WebContextMenuData& data) { 193 const WebContextMenuData& data) {
194 return web_view_->GetPage() 194 return web_view_->GetPage()
195 ->GetSettings() 195 ->GetSettings()
196 .GetAlwaysShowContextMenuOnTouch() || 196 .GetAlwaysShowContextMenuOnTouch() ||
197 !data.link_url.IsEmpty() || 197 !data.link_url.IsEmpty() ||
198 data.media_type == WebContextMenuData::kMediaTypeImage || 198 data.media_type == WebContextMenuData::kMediaTypeImage ||
199 data.media_type == WebContextMenuData::kMediaTypeVideo || 199 data.media_type == WebContextMenuData::kMediaTypeVideo ||
200 data.is_editable; 200 data.is_editable || !data.selected_text.IsEmpty();
201 } 201 }
202 202
203 static HTMLFormElement* AssociatedFormElement(HTMLElement& element) { 203 static HTMLFormElement* AssociatedFormElement(HTMLElement& element) {
204 if (isHTMLFormElement(element)) 204 if (isHTMLFormElement(element))
205 return &toHTMLFormElement(element); 205 return &toHTMLFormElement(element);
206 return element.formOwner(); 206 return element.formOwner();
207 } 207 }
208 208
209 // Scans logically forward from "start", including any child frames. 209 // Scans logically forward from "start", including any child frames.
210 static HTMLFormElement* ScanForForm(const Node* start) { 210 static HTMLFormElement* ScanForForm(const Node* start) {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 sub_menu_items.Swap(output_items); 559 sub_menu_items.Swap(output_items);
560 } 560 }
561 561
562 void ContextMenuClientImpl::PopulateCustomMenuItems( 562 void ContextMenuClientImpl::PopulateCustomMenuItems(
563 const ContextMenu* default_menu, 563 const ContextMenu* default_menu,
564 WebContextMenuData* data) { 564 WebContextMenuData* data) {
565 PopulateSubMenuItems(default_menu->Items(), data->custom_items); 565 PopulateSubMenuItems(default_menu->Items(), data->custom_items);
566 } 566 }
567 567
568 } // namespace blink 568 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/input/GestureManager.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698