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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
818 menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_VIEWFRAMEINFO, | 818 menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_VIEWFRAMEINFO, |
819 IDS_CONTENT_CONTEXT_VIEWFRAMEINFO); | 819 IDS_CONTENT_CONTEXT_VIEWFRAMEINFO); |
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 // AppendPluginItems() could already added |IDC_PRINT| so we are skipping | |
829 // here if |IDC_PRINT| is already present in context menu. | |
raymes
2014/10/07 17:09:14
nit:
// AppendPluginItems() could have already ad
| |
830 if (menu_model_.GetIndexOfCommandId(IDC_PRINT) != -1) | |
831 return; | |
832 | |
828 if (GetPrefs(browser_context_)->GetBoolean(prefs::kPrintingEnabled) && | 833 if (GetPrefs(browser_context_)->GetBoolean(prefs::kPrintingEnabled) && |
829 (params_.media_type == WebContextMenuData::MediaTypeNone || | 834 (params_.media_type == WebContextMenuData::MediaTypeNone || |
830 params_.media_flags & WebContextMenuData::MediaCanPrint)) { | 835 params_.media_flags & WebContextMenuData::MediaCanPrint)) { |
831 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); | 836 menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); |
832 } | 837 } |
833 } | 838 } |
834 | 839 |
835 void RenderViewContextMenu::AppendSearchProvider() { | 840 void RenderViewContextMenu::AppendSearchProvider() { |
836 DCHECK(browser_context_); | 841 DCHECK(browser_context_); |
837 | 842 |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1778 source_web_contents_->GetRenderViewHost()-> | 1783 source_web_contents_->GetRenderViewHost()-> |
1779 ExecuteMediaPlayerActionAtLocation(location, action); | 1784 ExecuteMediaPlayerActionAtLocation(location, action); |
1780 } | 1785 } |
1781 | 1786 |
1782 void RenderViewContextMenu::PluginActionAt( | 1787 void RenderViewContextMenu::PluginActionAt( |
1783 const gfx::Point& location, | 1788 const gfx::Point& location, |
1784 const WebPluginAction& action) { | 1789 const WebPluginAction& action) { |
1785 source_web_contents_->GetRenderViewHost()-> | 1790 source_web_contents_->GetRenderViewHost()-> |
1786 ExecutePluginActionAtLocation(location, action); | 1791 ExecutePluginActionAtLocation(location, action); |
1787 } | 1792 } |
OLD | NEW |