| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 using extensions::MenuManager; | 112 using extensions::MenuManager; |
| 113 | 113 |
| 114 namespace { | 114 namespace { |
| 115 | 115 |
| 116 // Usually a new tab is expected where this function is used, | 116 // Usually a new tab is expected where this function is used, |
| 117 // however users should be able to open a tab in background | 117 // however users should be able to open a tab in background |
| 118 // or in a new window. | 118 // or in a new window. |
| 119 WindowOpenDisposition ForceNewTabDispositionFromEventFlags( | 119 WindowOpenDisposition ForceNewTabDispositionFromEventFlags( |
| 120 int event_flags) { | 120 int event_flags) { |
| 121 WindowOpenDisposition disposition = | 121 WindowOpenDisposition disposition = |
| 122 chrome::DispositionFromEventFlags(event_flags); | 122 ui::DispositionFromEventFlags(event_flags); |
| 123 return disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition; | 123 return disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition; |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool IsCustomItemEnabled(const std::vector<WebMenuItem>& items, int id) { | 126 bool IsCustomItemEnabled(const std::vector<WebMenuItem>& items, int id) { |
| 127 DCHECK(id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && | 127 DCHECK(id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && |
| 128 id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST); | 128 id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST); |
| 129 for (size_t i = 0; i < items.size(); ++i) { | 129 for (size_t i = 0; i < items.size(); ++i) { |
| 130 int action_id = IDC_CONTENT_CONTEXT_CUSTOM_FIRST + items[i].action; | 130 int action_id = IDC_CONTENT_CONTEXT_CUSTOM_FIRST + items[i].action; |
| 131 if (action_id == id) | 131 if (action_id == id) |
| 132 return items[i].enabled; | 132 return items[i].enabled; |
| (...skipping 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1855 source_web_contents_->GetRenderViewHost()-> | 1855 source_web_contents_->GetRenderViewHost()-> |
| 1856 ExecuteMediaPlayerActionAtLocation(location, action); | 1856 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1857 } | 1857 } |
| 1858 | 1858 |
| 1859 void RenderViewContextMenu::PluginActionAt( | 1859 void RenderViewContextMenu::PluginActionAt( |
| 1860 const gfx::Point& location, | 1860 const gfx::Point& location, |
| 1861 const WebPluginAction& action) { | 1861 const WebPluginAction& action) { |
| 1862 source_web_contents_->GetRenderViewHost()-> | 1862 source_web_contents_->GetRenderViewHost()-> |
| 1863 ExecutePluginActionAtLocation(location, action); | 1863 ExecutePluginActionAtLocation(location, action); |
| 1864 } | 1864 } |
| OLD | NEW |