| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 using extensions::Extension; | 109 using extensions::Extension; |
| 110 | 110 |
| 111 namespace { | 111 namespace { |
| 112 | 112 |
| 113 // Usually a new tab is expected where this function is used, | 113 // Usually a new tab is expected where this function is used, |
| 114 // however users should be able to open a tab in background | 114 // however users should be able to open a tab in background |
| 115 // or in a new window. | 115 // or in a new window. |
| 116 WindowOpenDisposition ForceNewTabDispositionFromEventFlags( | 116 WindowOpenDisposition ForceNewTabDispositionFromEventFlags( |
| 117 int event_flags) { | 117 int event_flags) { |
| 118 WindowOpenDisposition disposition = | 118 WindowOpenDisposition disposition = |
| 119 browser::DispositionFromEventFlags(event_flags); | 119 chrome::DispositionFromEventFlags(event_flags); |
| 120 return disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition; | 120 return disposition == CURRENT_TAB ? NEW_FOREGROUND_TAB : disposition; |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool IsCustomItemEnabled(const std::vector<WebMenuItem>& items, int id) { | 123 bool IsCustomItemEnabled(const std::vector<WebMenuItem>& items, int id) { |
| 124 DCHECK(id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && | 124 DCHECK(id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST && |
| 125 id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST); | 125 id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST); |
| 126 for (size_t i = 0; i < items.size(); ++i) { | 126 for (size_t i = 0; i < items.size(); ++i) { |
| 127 int action_id = IDC_CONTENT_CONTEXT_CUSTOM_FIRST + items[i].action; | 127 int action_id = IDC_CONTENT_CONTEXT_CUSTOM_FIRST + items[i].action; |
| 128 if (action_id == id) | 128 if (action_id == id) |
| 129 return items[i].enabled; | 129 return items[i].enabled; |
| (...skipping 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2004 source_web_contents_->GetRenderViewHost()-> | 2004 source_web_contents_->GetRenderViewHost()-> |
| 2005 ExecuteMediaPlayerActionAtLocation(location, action); | 2005 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2006 } | 2006 } |
| 2007 | 2007 |
| 2008 void RenderViewContextMenu::PluginActionAt( | 2008 void RenderViewContextMenu::PluginActionAt( |
| 2009 const gfx::Point& location, | 2009 const gfx::Point& location, |
| 2010 const WebPluginAction& action) { | 2010 const WebPluginAction& action) { |
| 2011 source_web_contents_->GetRenderViewHost()-> | 2011 source_web_contents_->GetRenderViewHost()-> |
| 2012 ExecutePluginActionAtLocation(location, action); | 2012 ExecutePluginActionAtLocation(location, action); |
| 2013 } | 2013 } |
| OLD | NEW |