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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 base::TimeTicks::Now() - begin); | 405 base::TimeTicks::Now() - begin); |
406 UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index); | 406 UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index); |
407 } | 407 } |
408 | 408 |
409 void RenderViewContextMenu::InitMenu() { | 409 void RenderViewContextMenu::InitMenu() { |
410 if (chrome::IsRunningInForcedAppMode()) { | 410 if (chrome::IsRunningInForcedAppMode()) { |
411 AppendAppModeItems(); | 411 AppendAppModeItems(); |
412 return; | 412 return; |
413 } | 413 } |
414 | 414 |
415 chrome::ViewType view_type = chrome::GetViewType(source_web_contents_); | 415 extensions::ViewType view_type = chrome::GetViewType(source_web_contents_); |
416 if (view_type == chrome::VIEW_TYPE_APP_SHELL) { | 416 if (view_type == extensions::VIEW_TYPE_APP_SHELL) { |
417 AppendPlatformAppItems(); | 417 AppendPlatformAppItems(); |
418 return; | 418 return; |
419 } else if (view_type == chrome::VIEW_TYPE_EXTENSION_POPUP) { | 419 } else if (view_type == extensions::VIEW_TYPE_EXTENSION_POPUP) { |
420 AppendPopupExtensionItems(); | 420 AppendPopupExtensionItems(); |
421 return; | 421 return; |
422 } else if (view_type == chrome::VIEW_TYPE_PANEL) { | 422 } else if (view_type == extensions::VIEW_TYPE_PANEL) { |
423 AppendPanelItems(); | 423 AppendPanelItems(); |
424 return; | 424 return; |
425 } | 425 } |
426 | 426 |
427 const bool has_link = !params_.unfiltered_link_url.is_empty(); | 427 const bool has_link = !params_.unfiltered_link_url.is_empty(); |
428 const bool has_selection = !params_.selection_text.empty(); | 428 const bool has_selection = !params_.selection_text.empty(); |
429 | 429 |
430 if (AppendCustomItems()) { | 430 if (AppendCustomItems()) { |
431 // If there's a selection, don't early return when there are custom items, | 431 // If there's a selection, don't early return when there are custom items, |
432 // but fall through to adding the normal ones after the custom ones. | 432 // but fall through to adding the normal ones after the custom ones. |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 source_web_contents_->GetRenderViewHost()-> | 1890 source_web_contents_->GetRenderViewHost()-> |
1891 ExecuteMediaPlayerActionAtLocation(location, action); | 1891 ExecuteMediaPlayerActionAtLocation(location, action); |
1892 } | 1892 } |
1893 | 1893 |
1894 void RenderViewContextMenu::PluginActionAt( | 1894 void RenderViewContextMenu::PluginActionAt( |
1895 const gfx::Point& location, | 1895 const gfx::Point& location, |
1896 const WebPluginAction& action) { | 1896 const WebPluginAction& action) { |
1897 source_web_contents_->GetRenderViewHost()-> | 1897 source_web_contents_->GetRenderViewHost()-> |
1898 ExecutePluginActionAtLocation(location, action); | 1898 ExecutePluginActionAtLocation(location, action); |
1899 } | 1899 } |
OLD | NEW |