| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/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 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/browser/profiles/profile_info_cache.h" | 41 #include "chrome/browser/profiles/profile_info_cache.h" |
| 42 #include "chrome/browser/profiles/profile_io_data.h" | 42 #include "chrome/browser/profiles/profile_io_data.h" |
| 43 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
| 44 #include "chrome/browser/profiles/profile_window.h" | 44 #include "chrome/browser/profiles/profile_window.h" |
| 45 #include "chrome/browser/renderer_context_menu/context_menu_content_type_factory
.h" | 45 #include "chrome/browser/renderer_context_menu/context_menu_content_type_factory
.h" |
| 46 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" | 46 #include "chrome/browser/renderer_context_menu/spelling_menu_observer.h" |
| 47 #include "chrome/browser/search/search.h" | 47 #include "chrome/browser/search/search.h" |
| 48 #include "chrome/browser/search_engines/template_url_service_factory.h" | 48 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 49 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 49 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 50 #include "chrome/browser/spellchecker/spellcheck_service.h" | 50 #include "chrome/browser/spellchecker/spellcheck_service.h" |
| 51 #include "chrome/browser/ssl/security_state_model.h" | 51 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| 52 #include "chrome/browser/tab_contents/retargeting_details.h" | 52 #include "chrome/browser/tab_contents/retargeting_details.h" |
| 53 #include "chrome/browser/translate/chrome_translate_client.h" | 53 #include "chrome/browser/translate/chrome_translate_client.h" |
| 54 #include "chrome/browser/translate/translate_service.h" | 54 #include "chrome/browser/translate/translate_service.h" |
| 55 #include "chrome/browser/ui/browser.h" | 55 #include "chrome/browser/ui/browser.h" |
| 56 #include "chrome/browser/ui/browser_commands.h" | 56 #include "chrome/browser/ui/browser_commands.h" |
| 57 #include "chrome/browser/ui/browser_finder.h" | 57 #include "chrome/browser/ui/browser_finder.h" |
| 58 #include "chrome/browser/ui/browser_navigator_params.h" | 58 #include "chrome/browser/ui/browser_navigator_params.h" |
| 59 #include "chrome/browser/ui/chrome_pages.h" | 59 #include "chrome/browser/ui/chrome_pages.h" |
| 60 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 60 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 61 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 61 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { | 1941 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: { |
| 1942 NavigationController* controller = | 1942 NavigationController* controller = |
| 1943 &embedder_web_contents_->GetController(); | 1943 &embedder_web_contents_->GetController(); |
| 1944 // Important to use GetVisibleEntry to match what's showing in the | 1944 // Important to use GetVisibleEntry to match what's showing in the |
| 1945 // omnibox. This may return null. | 1945 // omnibox. This may return null. |
| 1946 NavigationEntry* nav_entry = controller->GetVisibleEntry(); | 1946 NavigationEntry* nav_entry = controller->GetVisibleEntry(); |
| 1947 if (!nav_entry) | 1947 if (!nav_entry) |
| 1948 return; | 1948 return; |
| 1949 Browser* browser = | 1949 Browser* browser = |
| 1950 chrome::FindBrowserWithWebContents(embedder_web_contents_); | 1950 chrome::FindBrowserWithWebContents(embedder_web_contents_); |
| 1951 SecurityStateModel* security_model = | 1951 ChromeSecurityStateModelClient* security_model_client = |
| 1952 SecurityStateModel::FromWebContents(embedder_web_contents_); | 1952 ChromeSecurityStateModelClient::FromWebContents( |
| 1953 DCHECK(security_model); | 1953 embedder_web_contents_); |
| 1954 DCHECK(security_model_client); |
| 1954 chrome::ShowWebsiteSettings(browser, embedder_web_contents_, | 1955 chrome::ShowWebsiteSettings(browser, embedder_web_contents_, |
| 1955 nav_entry->GetURL(), | 1956 nav_entry->GetURL(), |
| 1956 security_model->GetSecurityInfo()); | 1957 security_model_client->GetSecurityInfo()); |
| 1957 break; | 1958 break; |
| 1958 } | 1959 } |
| 1959 | 1960 |
| 1960 case IDC_CONTENT_CONTEXT_TRANSLATE: { | 1961 case IDC_CONTENT_CONTEXT_TRANSLATE: { |
| 1961 // A translation might have been triggered by the time the menu got | 1962 // A translation might have been triggered by the time the menu got |
| 1962 // selected, do nothing in that case. | 1963 // selected, do nothing in that case. |
| 1963 ChromeTranslateClient* chrome_translate_client = | 1964 ChromeTranslateClient* chrome_translate_client = |
| 1964 ChromeTranslateClient::FromWebContents(embedder_web_contents_); | 1965 ChromeTranslateClient::FromWebContents(embedder_web_contents_); |
| 1965 if (!chrome_translate_client || | 1966 if (!chrome_translate_client || |
| 1966 chrome_translate_client->GetLanguageState().IsPageTranslated() || | 1967 chrome_translate_client->GetLanguageState().IsPageTranslated() || |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2167 source_web_contents_->GetRenderViewHost()-> | 2168 source_web_contents_->GetRenderViewHost()-> |
| 2168 ExecuteMediaPlayerActionAtLocation(location, action); | 2169 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2169 } | 2170 } |
| 2170 | 2171 |
| 2171 void RenderViewContextMenu::PluginActionAt( | 2172 void RenderViewContextMenu::PluginActionAt( |
| 2172 const gfx::Point& location, | 2173 const gfx::Point& location, |
| 2173 const WebPluginAction& action) { | 2174 const WebPluginAction& action) { |
| 2174 source_web_contents_->GetRenderViewHost()-> | 2175 source_web_contents_->GetRenderViewHost()-> |
| 2175 ExecutePluginActionAtLocation(location, action); | 2176 ExecutePluginActionAtLocation(location, action); |
| 2176 } | 2177 } |
| OLD | NEW |