Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 } | 820 } |
| 821 | 821 |
| 822 void RenderViewContextMenu::AppendCopyItem() { | 822 void RenderViewContextMenu::AppendCopyItem() { |
| 823 menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_COPY, | 823 menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_COPY, |
| 824 IDS_CONTENT_CONTEXT_COPY); | 824 IDS_CONTENT_CONTEXT_COPY); |
| 825 } | 825 } |
| 826 | 826 |
| 827 void RenderViewContextMenu::AppendPrintItem() { | 827 void RenderViewContextMenu::AppendPrintItem() { |
| 828 if (GetPrefs(browser_context_)->GetBoolean(prefs::kPrintingEnabled) && | 828 if (GetPrefs(browser_context_)->GetBoolean(prefs::kPrintingEnabled) && |
| 829 (params_.media_type == WebContextMenuData::MediaTypeNone || | 829 (params_.media_type == WebContextMenuData::MediaTypeNone || |
| 830 params_.media_flags & WebContextMenuData::MediaCanPrint)) { | 830 params_.media_flags & WebContextMenuData::MediaCanPrint) && |
| 831 menu_model_.GetIndexOfCommandId(IDC_PRINT) == -1) { | |
|
lazyboy
2014/10/07 15:32:24
It's unfortunate that we have 3 places that decide
Deepak
2014/10/07 15:57:11
Done.
| |
| 831 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); | 832 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); |
| 832 } | 833 } |
| 833 } | 834 } |
| 834 | 835 |
| 835 void RenderViewContextMenu::AppendSearchProvider() { | 836 void RenderViewContextMenu::AppendSearchProvider() { |
| 836 DCHECK(browser_context_); | 837 DCHECK(browser_context_); |
| 837 | 838 |
| 838 base::TrimWhitespace(params_.selection_text, base::TRIM_ALL, | 839 base::TrimWhitespace(params_.selection_text, base::TRIM_ALL, |
| 839 ¶ms_.selection_text); | 840 ¶ms_.selection_text); |
| 840 if (params_.selection_text.empty()) | 841 if (params_.selection_text.empty()) |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1778 source_web_contents_->GetRenderViewHost()-> | 1779 source_web_contents_->GetRenderViewHost()-> |
| 1779 ExecuteMediaPlayerActionAtLocation(location, action); | 1780 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1780 } | 1781 } |
| 1781 | 1782 |
| 1782 void RenderViewContextMenu::PluginActionAt( | 1783 void RenderViewContextMenu::PluginActionAt( |
| 1783 const gfx::Point& location, | 1784 const gfx::Point& location, |
| 1784 const WebPluginAction& action) { | 1785 const WebPluginAction& action) { |
| 1785 source_web_contents_->GetRenderViewHost()-> | 1786 source_web_contents_->GetRenderViewHost()-> |
| 1786 ExecutePluginActionAtLocation(location, action); | 1787 ExecutePluginActionAtLocation(location, action); |
| 1787 } | 1788 } |
| OLD | NEW |