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 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 // language. | 1160 // language. |
1161 return ((params_.edit_flags & WebContextMenuData::CanTranslate) != 0) && | 1161 return ((params_.edit_flags & WebContextMenuData::CanTranslate) != 0) && |
1162 !original_lang.empty() && // Did we receive the page language yet? | 1162 !original_lang.empty() && // Did we receive the page language yet? |
1163 !chrome_translate_client->GetLanguageState().IsPageTranslated() && | 1163 !chrome_translate_client->GetLanguageState().IsPageTranslated() && |
1164 !embedder_web_contents_->GetInterstitialPage() && | 1164 !embedder_web_contents_->GetInterstitialPage() && |
1165 // There are some application locales which can't be used as a | 1165 // There are some application locales which can't be used as a |
1166 // target language for translation. | 1166 // target language for translation. |
1167 translate::TranslateDownloadManager::IsSupportedLanguage( | 1167 translate::TranslateDownloadManager::IsSupportedLanguage( |
1168 target_lang) && | 1168 target_lang) && |
1169 // Disable on the Instant Extended NTP. | 1169 // Disable on the Instant Extended NTP. |
1170 !chrome::IsInstantNTP(embedder_web_contents_); | 1170 !search::IsInstantNTP(embedder_web_contents_); |
1171 } | 1171 } |
1172 | 1172 |
1173 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: | 1173 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: |
1174 case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: | 1174 case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: |
1175 return params_.link_url.is_valid(); | 1175 return params_.link_url.is_valid(); |
1176 | 1176 |
1177 case IDC_CONTENT_CONTEXT_COPYLINKLOCATION: | 1177 case IDC_CONTENT_CONTEXT_COPYLINKLOCATION: |
1178 return params_.unfiltered_link_url.is_valid(); | 1178 return params_.unfiltered_link_url.is_valid(); |
1179 | 1179 |
1180 case IDC_CONTENT_CONTEXT_SAVELINKAS: { | 1180 case IDC_CONTENT_CONTEXT_SAVELINKAS: { |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 source_web_contents_->GetRenderViewHost()-> | 1929 source_web_contents_->GetRenderViewHost()-> |
1930 ExecuteMediaPlayerActionAtLocation(location, action); | 1930 ExecuteMediaPlayerActionAtLocation(location, action); |
1931 } | 1931 } |
1932 | 1932 |
1933 void RenderViewContextMenu::PluginActionAt( | 1933 void RenderViewContextMenu::PluginActionAt( |
1934 const gfx::Point& location, | 1934 const gfx::Point& location, |
1935 const WebPluginAction& action) { | 1935 const WebPluginAction& action) { |
1936 source_web_contents_->GetRenderViewHost()-> | 1936 source_web_contents_->GetRenderViewHost()-> |
1937 ExecutePluginActionAtLocation(location, action); | 1937 ExecutePluginActionAtLocation(location, action); |
1938 } | 1938 } |
OLD | NEW |