| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 526 |
| 527 // static | 527 // static |
| 528 bool RenderViewContextMenu::IsDevToolsURL(const GURL& url) { | 528 bool RenderViewContextMenu::IsDevToolsURL(const GURL& url) { |
| 529 return url.SchemeIs(content::kChromeDevToolsScheme); | 529 return url.SchemeIs(content::kChromeDevToolsScheme); |
| 530 } | 530 } |
| 531 | 531 |
| 532 // static | 532 // static |
| 533 bool RenderViewContextMenu::IsInternalResourcesURL(const GURL& url) { | 533 bool RenderViewContextMenu::IsInternalResourcesURL(const GURL& url) { |
| 534 if (!url.SchemeIs(content::kChromeUIScheme)) | 534 if (!url.SchemeIs(content::kChromeUIScheme)) |
| 535 return false; | 535 return false; |
| 536 return url.host() == chrome::kChromeUISyncResourcesHost; | 536 return url.host_piece() == chrome::kChromeUISyncResourcesHost; |
| 537 } | 537 } |
| 538 | 538 |
| 539 // static | 539 // static |
| 540 void RenderViewContextMenu::AddSpellCheckServiceItem(ui::SimpleMenuModel* menu, | 540 void RenderViewContextMenu::AddSpellCheckServiceItem(ui::SimpleMenuModel* menu, |
| 541 bool is_checked) { | 541 bool is_checked) { |
| 542 // When the Google branding experiment is enabled, we want to show an icon | 542 // When the Google branding experiment is enabled, we want to show an icon |
| 543 // next to this item, but we can't show icons on check items. So when the | 543 // next to this item, but we can't show icons on check items. So when the |
| 544 // item is enabled show it as checked, and otherwise add it as a normal item | 544 // item is enabled show it as checked, and otherwise add it as a normal item |
| 545 // (instead of a check item) so that, if necessary, we can add the Google | 545 // (instead of a check item) so that, if necessary, we can add the Google |
| 546 // icon. (If the experiment is off, there's no harm in adding this as a | 546 // icon. (If the experiment is off, there's no harm in adding this as a |
| (...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2498 void RenderViewContextMenu::PluginActionAt( | 2498 void RenderViewContextMenu::PluginActionAt( |
| 2499 const gfx::Point& location, | 2499 const gfx::Point& location, |
| 2500 const WebPluginAction& action) { | 2500 const WebPluginAction& action) { |
| 2501 source_web_contents_->GetRenderViewHost()-> | 2501 source_web_contents_->GetRenderViewHost()-> |
| 2502 ExecutePluginActionAtLocation(location, action); | 2502 ExecutePluginActionAtLocation(location, action); |
| 2503 } | 2503 } |
| 2504 | 2504 |
| 2505 Browser* RenderViewContextMenu::GetBrowser() const { | 2505 Browser* RenderViewContextMenu::GetBrowser() const { |
| 2506 return chrome::FindBrowserWithWebContents(embedder_web_contents_); | 2506 return chrome::FindBrowserWithWebContents(embedder_web_contents_); |
| 2507 } | 2507 } |
| OLD | NEW |