| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 case IDC_CONTENT_CONTEXT_OPENAVNEWTAB: | 1593 case IDC_CONTENT_CONTEXT_OPENAVNEWTAB: |
| 1594 // Currently, a media element can be opened in a new tab iff it can | 1594 // Currently, a media element can be opened in a new tab iff it can |
| 1595 // be saved. So rather than duplicating the MediaCanSave flag, we rely | 1595 // be saved. So rather than duplicating the MediaCanSave flag, we rely |
| 1596 // on that here. | 1596 // on that here. |
| 1597 return !!(params_.media_flags & WebContextMenuData::MediaCanSave); | 1597 return !!(params_.media_flags & WebContextMenuData::MediaCanSave); |
| 1598 | 1598 |
| 1599 case IDC_SAVE_PAGE: | 1599 case IDC_SAVE_PAGE: |
| 1600 return IsSavePageEnabled(); | 1600 return IsSavePageEnabled(); |
| 1601 | 1601 |
| 1602 case IDC_CONTENT_CONTEXT_RELOADFRAME: | 1602 case IDC_CONTENT_CONTEXT_RELOADFRAME: |
| 1603 return params_.frame_url.is_valid(); | 1603 return params_.frame_url.is_valid() && |
| 1604 params_.frame_url.GetOrigin() != chrome::kChromeUIPrintURL; |
| 1604 | 1605 |
| 1605 case IDC_CONTENT_CONTEXT_UNDO: | 1606 case IDC_CONTENT_CONTEXT_UNDO: |
| 1606 return !!(params_.edit_flags & WebContextMenuData::CanUndo); | 1607 return !!(params_.edit_flags & WebContextMenuData::CanUndo); |
| 1607 | 1608 |
| 1608 case IDC_CONTENT_CONTEXT_REDO: | 1609 case IDC_CONTENT_CONTEXT_REDO: |
| 1609 return !!(params_.edit_flags & WebContextMenuData::CanRedo); | 1610 return !!(params_.edit_flags & WebContextMenuData::CanRedo); |
| 1610 | 1611 |
| 1611 case IDC_CONTENT_CONTEXT_CUT: | 1612 case IDC_CONTENT_CONTEXT_CUT: |
| 1612 return !!(params_.edit_flags & WebContextMenuData::CanCut); | 1613 return !!(params_.edit_flags & WebContextMenuData::CanCut); |
| 1613 | 1614 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 void RenderViewContextMenu::PluginActionAt( | 2499 void RenderViewContextMenu::PluginActionAt( |
| 2499 const gfx::Point& location, | 2500 const gfx::Point& location, |
| 2500 const WebPluginAction& action) { | 2501 const WebPluginAction& action) { |
| 2501 source_web_contents_->GetRenderViewHost()-> | 2502 source_web_contents_->GetRenderViewHost()-> |
| 2502 ExecutePluginActionAtLocation(location, action); | 2503 ExecutePluginActionAtLocation(location, action); |
| 2503 } | 2504 } |
| 2504 | 2505 |
| 2505 Browser* RenderViewContextMenu::GetBrowser() const { | 2506 Browser* RenderViewContextMenu::GetBrowser() const { |
| 2506 return chrome::FindBrowserWithWebContents(embedder_web_contents_); | 2507 return chrome::FindBrowserWithWebContents(embedder_web_contents_); |
| 2507 } | 2508 } |
| OLD | NEW |