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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 628403003: In pdf context menu 'Print..' is coming 2 times. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per comments. Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698