OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 7 |
8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 return url.host() == chrome::kChromeUISyncResourcesHost; | 181 return url.host() == chrome::kChromeUISyncResourcesHost; |
182 } | 182 } |
183 | 183 |
184 static const int kSpellcheckRadioGroup = 1; | 184 static const int kSpellcheckRadioGroup = 1; |
185 | 185 |
186 RenderViewContextMenu::RenderViewContextMenu( | 186 RenderViewContextMenu::RenderViewContextMenu( |
187 TabContents* tab_contents, | 187 TabContents* tab_contents, |
188 const ContextMenuParams& params) | 188 const ContextMenuParams& params) |
189 : params_(params), | 189 : params_(params), |
190 source_tab_contents_(tab_contents), | 190 source_tab_contents_(tab_contents), |
191 profile_(tab_contents->profile()), | 191 profile_(static_cast<Profile*>(tab_contents->context())), |
192 ALLOW_THIS_IN_INITIALIZER_LIST(menu_model_(this)), | 192 ALLOW_THIS_IN_INITIALIZER_LIST(menu_model_(this)), |
193 external_(false), | 193 external_(false), |
194 ALLOW_THIS_IN_INITIALIZER_LIST(spellcheck_submenu_model_(this)), | 194 ALLOW_THIS_IN_INITIALIZER_LIST(spellcheck_submenu_model_(this)), |
195 ALLOW_THIS_IN_INITIALIZER_LIST(bidi_submenu_model_(this)), | 195 ALLOW_THIS_IN_INITIALIZER_LIST(bidi_submenu_model_(this)), |
196 ALLOW_THIS_IN_INITIALIZER_LIST(protocol_handler_submenu_model_(this)), | 196 ALLOW_THIS_IN_INITIALIZER_LIST(protocol_handler_submenu_model_(this)), |
197 protocol_handler_registry_( | 197 protocol_handler_registry_(profile_->GetProtocolHandlerRegistry()) { |
198 tab_contents->profile()->GetProtocolHandlerRegistry()) { | |
199 } | 198 } |
200 | 199 |
201 RenderViewContextMenu::~RenderViewContextMenu() { | 200 RenderViewContextMenu::~RenderViewContextMenu() { |
202 } | 201 } |
203 | 202 |
204 // Menu construction functions ------------------------------------------------- | 203 // Menu construction functions ------------------------------------------------- |
205 | 204 |
206 void RenderViewContextMenu::Init() { | 205 void RenderViewContextMenu::Init() { |
207 InitMenu(); | 206 InitMenu(); |
208 PlatformInit(); | 207 PlatformInit(); |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 g_browser_process->clipboard()); | 1742 g_browser_process->clipboard()); |
1744 } | 1743 } |
1745 | 1744 |
1746 void RenderViewContextMenu::MediaPlayerActionAt( | 1745 void RenderViewContextMenu::MediaPlayerActionAt( |
1747 const gfx::Point& location, | 1746 const gfx::Point& location, |
1748 const WebMediaPlayerAction& action) { | 1747 const WebMediaPlayerAction& action) { |
1749 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1748 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
1750 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1749 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
1751 rvh->routing_id(), location, action)); | 1750 rvh->routing_id(), location, action)); |
1752 } | 1751 } |
OLD | NEW |