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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 10828392: Context menus for text fields in platform apps should show available actions (copy, paste, etc). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix conflicts Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index ed85888419c8796d34acedf1fc8f754c03561c40..f519aa054fff89bbd508eb7713b21d8efde0aa88 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -658,6 +658,14 @@ void RenderViewContextMenu::AppendPlatformAppItems() {
DCHECK(platform_app);
DCHECK(platform_app->is_platform_app());
+ bool has_selection = !params_.selection_text.empty();
+
+ // Add undo/redo, cut/copy/paste etc for text fields
+ if (params_.is_editable)
+ AppendEditableItems();
+ else if (has_selection)
+ AppendCopyItem();
+
int index = 0;
AppendExtensionItems(platform_app->id(), &index);
« no previous file with comments | « chrome/browser/extensions/platform_app_browsertest.cc ('k') | chrome/test/data/extensions/platform_apps/context_menu/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698