Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 417063004: Separate Toolkit specific impl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 source_web_contents_, params)); 452 source_web_contents_, params));
453 } 453 }
454 454
455 RenderViewContextMenu::~RenderViewContextMenu() { 455 RenderViewContextMenu::~RenderViewContextMenu() {
456 } 456 }
457 457
458 // Menu construction functions ------------------------------------------------- 458 // Menu construction functions -------------------------------------------------
459 459
460 void RenderViewContextMenu::Init() { 460 void RenderViewContextMenu::Init() {
461 InitMenu(); 461 InitMenu();
462 PlatformInit(); 462 if (toolkit_delegate_)
463 toolkit_delegate_->Init(&menu_model_);
463 } 464 }
464 465
465 void RenderViewContextMenu::Cancel() { 466 void RenderViewContextMenu::Cancel() {
466 PlatformCancel(); 467 if (toolkit_delegate_)
468 toolkit_delegate_->Cancel();
467 } 469 }
468 470
469 static bool ExtensionPatternMatch(const extensions::URLPatternSet& patterns, 471 static bool ExtensionPatternMatch(const extensions::URLPatternSet& patterns,
470 const GURL& url) { 472 const GURL& url) {
471 // No patterns means no restriction, so that implicitly matches. 473 // No patterns means no restriction, so that implicitly matches.
472 if (patterns.is_empty()) 474 if (patterns.is_empty())
473 return true; 475 return true;
474 return patterns.MatchesURL(url); 476 return patterns.MatchesURL(url);
475 } 477 }
476 478
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 void RenderViewContextMenu::AddSubMenu(int command_id, 764 void RenderViewContextMenu::AddSubMenu(int command_id,
763 const base::string16& label, 765 const base::string16& label,
764 ui::MenuModel* model) { 766 ui::MenuModel* model) {
765 menu_model_.AddSubMenu(command_id, label, model); 767 menu_model_.AddSubMenu(command_id, label, model);
766 } 768 }
767 769
768 void RenderViewContextMenu::UpdateMenuItem(int command_id, 770 void RenderViewContextMenu::UpdateMenuItem(int command_id,
769 bool enabled, 771 bool enabled,
770 bool hidden, 772 bool hidden,
771 const base::string16& label) { 773 const base::string16& label) {
772 // This function needs platform-specific implementation. 774 if (toolkit_delegate_) {
773 NOTIMPLEMENTED(); 775 toolkit_delegate_->UpdateMenuItem(command_id,
776 enabled,
lazyboy 2014/07/31 18:59:04 Indent.
oshima 2014/07/31 19:51:14 Done.
777 hidden,
778 label);
779 }
774 } 780 }
775 781
776 RenderViewHost* RenderViewContextMenu::GetRenderViewHost() const { 782 RenderViewHost* RenderViewContextMenu::GetRenderViewHost() const {
777 return source_web_contents_->GetRenderViewHost(); 783 return source_web_contents_->GetRenderViewHost();
778 } 784 }
779 785
780 WebContents* RenderViewContextMenu::GetWebContents() const { 786 WebContents* RenderViewContextMenu::GetWebContents() const {
781 return source_web_contents_; 787 return source_web_contents_;
782 } 788 }
783 789
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 source_web_contents_->GetRenderViewHost()-> 2041 source_web_contents_->GetRenderViewHost()->
2036 ExecuteMediaPlayerActionAtLocation(location, action); 2042 ExecuteMediaPlayerActionAtLocation(location, action);
2037 } 2043 }
2038 2044
2039 void RenderViewContextMenu::PluginActionAt( 2045 void RenderViewContextMenu::PluginActionAt(
2040 const gfx::Point& location, 2046 const gfx::Point& location,
2041 const WebPluginAction& action) { 2047 const WebPluginAction& action) {
2042 source_web_contents_->GetRenderViewHost()-> 2048 source_web_contents_->GetRenderViewHost()->
2043 ExecutePluginActionAtLocation(location, action); 2049 ExecutePluginActionAtLocation(location, action);
2044 } 2050 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698