Chromium Code Reviews| 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..5dbdab88d163a96881ba2410e09df48848aa40ca 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,11 @@ 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 |
| + // launched with out of process flags then |content_type_->SupportsGroup| |
| + // does not have |ContextMenuContentType::ITEM_GROUP_PRINT|. |
| + if (!content_type_->SupportsGroup(ContextMenuContentType::ITEM_GROUP_PRINT)) |
|
raymes
2014/10/09 20:29:09
I don't fully understand this bit. Why do we add a
|
| + menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT); |
| } |
| } |
| @@ -837,6 +838,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_); |