OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |