| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // static | 383 // static |
| 384 const size_t RenderViewContextMenu::kMaxSelectionTextLength = 50; | 384 const size_t RenderViewContextMenu::kMaxSelectionTextLength = 50; |
| 385 | 385 |
| 386 // static | 386 // static |
| 387 bool RenderViewContextMenu::IsDevToolsURL(const GURL& url) { | 387 bool RenderViewContextMenu::IsDevToolsURL(const GURL& url) { |
| 388 return url.SchemeIs(chrome::kChromeDevToolsScheme); | 388 return url.SchemeIs(chrome::kChromeDevToolsScheme); |
| 389 } | 389 } |
| 390 | 390 |
| 391 // static | 391 // static |
| 392 bool RenderViewContextMenu::IsInternalResourcesURL(const GURL& url) { | 392 bool RenderViewContextMenu::IsInternalResourcesURL(const GURL& url) { |
| 393 if (!url.SchemeIs(chrome::kChromeUIScheme)) | 393 if (!url.SchemeIs(content::kChromeUIScheme)) |
| 394 return false; | 394 return false; |
| 395 return url.host() == chrome::kChromeUISyncResourcesHost; | 395 return url.host() == chrome::kChromeUISyncResourcesHost; |
| 396 } | 396 } |
| 397 | 397 |
| 398 static const int kSpellcheckRadioGroup = 1; | 398 static const int kSpellcheckRadioGroup = 1; |
| 399 | 399 |
| 400 RenderViewContextMenu::RenderViewContextMenu( | 400 RenderViewContextMenu::RenderViewContextMenu( |
| 401 content::RenderFrameHost* render_frame_host, | 401 content::RenderFrameHost* render_frame_host, |
| 402 const content::ContextMenuParams& params) | 402 const content::ContextMenuParams& params) |
| 403 : params_(params), | 403 : params_(params), |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 | 1280 |
| 1281 return params_.src_url.is_valid() && | 1281 return params_.src_url.is_valid() && |
| 1282 ProfileIOData::IsHandledProtocol(params_.src_url.scheme()); | 1282 ProfileIOData::IsHandledProtocol(params_.src_url.scheme()); |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 // The images shown in the most visited thumbnails can't be opened or | 1285 // The images shown in the most visited thumbnails can't be opened or |
| 1286 // searched for conventionally. | 1286 // searched for conventionally. |
| 1287 case IDC_CONTENT_CONTEXT_OPENIMAGENEWTAB: | 1287 case IDC_CONTENT_CONTEXT_OPENIMAGENEWTAB: |
| 1288 case IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE: | 1288 case IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE: |
| 1289 return params_.src_url.is_valid() && | 1289 return params_.src_url.is_valid() && |
| 1290 (params_.src_url.scheme() != chrome::kChromeUIScheme); | 1290 (params_.src_url.scheme() != content::kChromeUIScheme); |
| 1291 | 1291 |
| 1292 case IDC_CONTENT_CONTEXT_COPYIMAGE: | 1292 case IDC_CONTENT_CONTEXT_COPYIMAGE: |
| 1293 return params_.has_image_contents; | 1293 return params_.has_image_contents; |
| 1294 | 1294 |
| 1295 // Media control commands should all be disabled if the player is in an | 1295 // Media control commands should all be disabled if the player is in an |
| 1296 // error state. | 1296 // error state. |
| 1297 case IDC_CONTENT_CONTEXT_PLAYPAUSE: | 1297 case IDC_CONTENT_CONTEXT_PLAYPAUSE: |
| 1298 case IDC_CONTENT_CONTEXT_LOOP: | 1298 case IDC_CONTENT_CONTEXT_LOOP: |
| 1299 return (params_.media_flags & | 1299 return (params_.media_flags & |
| 1300 WebContextMenuData::MediaInError) == 0; | 1300 WebContextMenuData::MediaInError) == 0; |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 source_web_contents_->GetRenderViewHost()-> | 2107 source_web_contents_->GetRenderViewHost()-> |
| 2108 ExecuteMediaPlayerActionAtLocation(location, action); | 2108 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2109 } | 2109 } |
| 2110 | 2110 |
| 2111 void RenderViewContextMenu::PluginActionAt( | 2111 void RenderViewContextMenu::PluginActionAt( |
| 2112 const gfx::Point& location, | 2112 const gfx::Point& location, |
| 2113 const WebPluginAction& action) { | 2113 const WebPluginAction& action) { |
| 2114 source_web_contents_->GetRenderViewHost()-> | 2114 source_web_contents_->GetRenderViewHost()-> |
| 2115 ExecutePluginActionAtLocation(location, action); | 2115 ExecutePluginActionAtLocation(location, action); |
| 2116 } | 2116 } |
| OLD | NEW |