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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <utility> 7 #include <utility>
8 8
9 #include "chrome/browser/tab_contents/render_view_context_menu.h" 9 #include "chrome/browser/tab_contents/render_view_context_menu.h"
10 10
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 649
650 void RenderViewContextMenu::AppendPlatformAppItems() { 650 void RenderViewContextMenu::AppendPlatformAppItems() {
651 const Extension* platform_app = GetExtension(); 651 const Extension* platform_app = GetExtension();
652 DCHECK(platform_app); 652 DCHECK(platform_app);
653 DCHECK(platform_app->is_platform_app()); 653 DCHECK(platform_app->is_platform_app());
654 654
655 int index = 0; 655 int index = 0;
656 AppendExtensionItems(platform_app->id(), &index); 656 AppendExtensionItems(platform_app->id(), &index);
657 657
658 // Add undo/redo, cut/copy/paste etc for text fields
659 if (params_.is_editable) {
660 if (menu_model_.GetItemCount() > 0)
661 menu_model_.AddSeparator();
662 AppendEditableItems();
663 }
asargent_no_longer_on_chrome 2012/08/20 19:40:21 I think we also want to add the copy menu command
Marijn Kruisselbrink 2012/08/20 19:46:58 I thought about that, but as far as I could tell i
664
658 // Add dev tools for unpacked extensions. 665 // Add dev tools for unpacked extensions.
659 if (platform_app->location() == Extension::LOAD) { 666 if (platform_app->location() == Extension::LOAD) {
660 menu_model_.AddItemWithStringId(IDC_RELOAD, IDS_CONTENT_CONTEXT_RELOAD); 667 menu_model_.AddItemWithStringId(IDC_RELOAD, IDS_CONTENT_CONTEXT_RELOAD);
661 AppendDeveloperItems(); 668 AppendDeveloperItems();
662 } 669 }
663 } 670 }
664 671
665 void RenderViewContextMenu::AppendPopupExtensionItems() { 672 void RenderViewContextMenu::AppendPopupExtensionItems() {
666 bool has_selection = !params_.selection_text.empty(); 673 bool has_selection = !params_.selection_text.empty();
667 674
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 source_web_contents_->GetRenderViewHost()-> 2016 source_web_contents_->GetRenderViewHost()->
2010 ExecuteMediaPlayerActionAtLocation(location, action); 2017 ExecuteMediaPlayerActionAtLocation(location, action);
2011 } 2018 }
2012 2019
2013 void RenderViewContextMenu::PluginActionAt( 2020 void RenderViewContextMenu::PluginActionAt(
2014 const gfx::Point& location, 2021 const gfx::Point& location,
2015 const WebPluginAction& action) { 2022 const WebPluginAction& action) {
2016 source_web_contents_->GetRenderViewHost()-> 2023 source_web_contents_->GetRenderViewHost()->
2017 ExecutePluginActionAtLocation(location, action); 2024 ExecutePluginActionAtLocation(location, action);
2018 } 2025 }
OLDNEW
« 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