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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 632243002: |Print..| menu should be consistent in contextmenu with and without selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes in 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_context_menu/render_view_context_menu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 5574ba030d2f9ec91b3ebc43bcfd7fc0e6a52392..cc662325e33af84208442e8484769d1d1f9476ac 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -544,6 +544,11 @@ void RenderViewContextMenu::InitMenu() {
AppendPrintItem();
if (content_type_->SupportsGroup(
+ ContextMenuContentType::ITEM_GROUP_MEDIA_PLUGIN)) {
+ AppendRotationItems();
+ }
+
+ if (content_type_->SupportsGroup(
ContextMenuContentType::ITEM_GROUP_ALL_EXTENSION)) {
DCHECK(!content_type_->SupportsGroup(
ContextMenuContentType::ITEM_GROUP_CURRENT_EXTENSION));
@@ -769,15 +774,12 @@ void RenderViewContextMenu::AppendPluginItems() {
} else {
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_SAVEAVAS,
IDS_CONTENT_CONTEXT_SAVEPAGEAS);
- menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
- }
-
- if (params_.media_flags & WebContextMenuData::MediaCanRotate) {
- menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
- menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_ROTATECW,
- IDS_CONTENT_CONTEXT_ROTATECW);
- menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_ROTATECCW,
- IDS_CONTENT_CONTEXT_ROTATECCW);
+ // |IDC_PRINT| should be added here as we want print menu item. When pdf
+ // plugin is un-embedded then |content_type_->SupportsGroup| does not have
+ // |ContextMenuContentType::ITEM_GROUP_PRINT| so |IDC_PRINT| will not be
+ // added by |AppendPrintItem|function call.
raymes 2014/10/13 16:53:29 Would it be accurate to reword the comment as foll
+ if (!content_type_->SupportsGroup(ContextMenuContentType::ITEM_GROUP_PRINT))
+ menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
}
}
@@ -837,6 +839,16 @@ void RenderViewContextMenu::AppendPrintItem() {
}
}
+void RenderViewContextMenu::AppendRotationItems() {
+ if (params_.media_flags & WebContextMenuData::MediaCanRotate) {
+ menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
+ menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_ROTATECW,
+ IDS_CONTENT_CONTEXT_ROTATECW);
+ menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_ROTATECCW,
+ IDS_CONTENT_CONTEXT_ROTATECCW);
+ }
+}
+
void RenderViewContextMenu::AppendSearchProvider() {
DCHECK(browser_context_);
« no previous file with comments | « chrome/browser/renderer_context_menu/render_view_context_menu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698