| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "chrome/browser/tab_contents/retargeting_details.h" | 43 #include "chrome/browser/tab_contents/retargeting_details.h" |
| 44 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 44 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
| 45 #include "chrome/browser/tab_contents/spelling_menu_observer.h" | 45 #include "chrome/browser/tab_contents/spelling_menu_observer.h" |
| 46 #include "chrome/browser/translate/translate_manager.h" | 46 #include "chrome/browser/translate/translate_manager.h" |
| 47 #include "chrome/browser/translate/translate_prefs.h" | 47 #include "chrome/browser/translate/translate_prefs.h" |
| 48 #include "chrome/browser/translate/translate_tab_helper.h" | 48 #include "chrome/browser/translate/translate_tab_helper.h" |
| 49 #include "chrome/browser/ui/browser.h" | 49 #include "chrome/browser/ui/browser.h" |
| 50 #include "chrome/browser/ui/browser_finder.h" | 50 #include "chrome/browser/ui/browser_finder.h" |
| 51 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 51 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 52 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 52 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 53 #include "chrome/browser/view_type_utils.h" |
| 53 #include "chrome/common/chrome_constants.h" | 54 #include "chrome/common/chrome_constants.h" |
| 54 #include "chrome/common/chrome_notification_types.h" | 55 #include "chrome/common/chrome_notification_types.h" |
| 55 #include "chrome/common/chrome_switches.h" | 56 #include "chrome/common/chrome_switches.h" |
| 56 #include "chrome/common/chrome_view_type.h" | |
| 57 #include "chrome/common/extensions/extension.h" | 57 #include "chrome/common/extensions/extension.h" |
| 58 #include "chrome/common/net/url_util.h" | 58 #include "chrome/common/net/url_util.h" |
| 59 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
| 60 #include "chrome/common/print_messages.h" | 60 #include "chrome/common/print_messages.h" |
| 61 #include "chrome/common/spellcheck_messages.h" | 61 #include "chrome/common/spellcheck_messages.h" |
| 62 #include "chrome/common/url_constants.h" | 62 #include "chrome/common/url_constants.h" |
| 63 #include "content/public/browser/child_process_security_policy.h" | 63 #include "content/public/browser/child_process_security_policy.h" |
| 64 #include "content/public/browser/download_manager.h" | 64 #include "content/public/browser/download_manager.h" |
| 65 #include "content/public/browser/download_save_info.h" | 65 #include "content/public/browser/download_save_info.h" |
| 66 #include "content/public/browser/download_url_parameters.h" | 66 #include "content/public/browser/download_url_parameters.h" |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 for (i = sorted_ids.begin(); | 526 for (i = sorted_ids.begin(); |
| 527 i != sorted_ids.end(); ++i) { | 527 i != sorted_ids.end(); ++i) { |
| 528 AppendExtensionItems(i->second, &index); | 528 AppendExtensionItems(i->second, &index); |
| 529 } | 529 } |
| 530 UMA_HISTOGRAM_TIMES("Extensions.ContextMenus_BuildTime", | 530 UMA_HISTOGRAM_TIMES("Extensions.ContextMenus_BuildTime", |
| 531 base::TimeTicks::Now() - begin); | 531 base::TimeTicks::Now() - begin); |
| 532 UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index); | 532 UMA_HISTOGRAM_COUNTS("Extensions.ContextMenus_ItemCount", index); |
| 533 } | 533 } |
| 534 | 534 |
| 535 void RenderViewContextMenu::InitMenu() { | 535 void RenderViewContextMenu::InitMenu() { |
| 536 content::ViewType view_type = source_web_contents_->GetViewType(); | 536 chrome::ViewType view_type = chrome::GetViewType(source_web_contents_); |
| 537 if (view_type == chrome::VIEW_TYPE_APP_SHELL) { | 537 if (view_type == chrome::VIEW_TYPE_APP_SHELL) { |
| 538 AppendPlatformAppItems(); | 538 AppendPlatformAppItems(); |
| 539 return; | 539 return; |
| 540 } else if (view_type == chrome::VIEW_TYPE_EXTENSION_POPUP) { | 540 } else if (view_type == chrome::VIEW_TYPE_EXTENSION_POPUP) { |
| 541 AppendPopupExtensionItems(); | 541 AppendPopupExtensionItems(); |
| 542 return; | 542 return; |
| 543 } | 543 } |
| 544 | 544 |
| 545 bool has_link = !params_.unfiltered_link_url.is_empty(); | 545 bool has_link = !params_.unfiltered_link_url.is_empty(); |
| 546 bool has_selection = !params_.selection_text.empty(); | 546 bool has_selection = !params_.selection_text.empty(); |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1984 source_web_contents_->GetRenderViewHost()-> | 1984 source_web_contents_->GetRenderViewHost()-> |
| 1985 ExecuteMediaPlayerActionAtLocation(location, action); | 1985 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1986 } | 1986 } |
| 1987 | 1987 |
| 1988 void RenderViewContextMenu::PluginActionAt( | 1988 void RenderViewContextMenu::PluginActionAt( |
| 1989 const gfx::Point& location, | 1989 const gfx::Point& location, |
| 1990 const WebPluginAction& action) { | 1990 const WebPluginAction& action) { |
| 1991 source_web_contents_->GetRenderViewHost()-> | 1991 source_web_contents_->GetRenderViewHost()-> |
| 1992 ExecutePluginActionAtLocation(location, action); | 1992 ExecutePluginActionAtLocation(location, action); |
| 1993 } | 1993 } |
| OLD | NEW |