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

Side by Side Diff: athena/content/render_view_context_menu_impl.cc

Issue 453993002: IsCommandIdEnabled should not fall though if the base did handle the command id (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 "athena/content/render_view_context_menu_impl.h" 5 #include "athena/content/render_view_context_menu_impl.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "components/renderer_context_menu/context_menu_content_type.h" 8 #include "components/renderer_context_menu/context_menu_content_type.h"
9 #include "components/renderer_context_menu/views/toolkit_delegate_views.h" 9 #include "components/renderer_context_menu/views/toolkit_delegate_views.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 ui::Accelerator* accelerator) { 93 ui::Accelerator* accelerator) {
94 NOTIMPLEMENTED(); 94 NOTIMPLEMENTED();
95 return false; 95 return false;
96 } 96 }
97 97
98 bool RenderViewContextMenuImpl::IsCommandIdChecked(int command_id) const { 98 bool RenderViewContextMenuImpl::IsCommandIdChecked(int command_id) const {
99 return false; 99 return false;
100 } 100 }
101 101
102 bool RenderViewContextMenuImpl::IsCommandIdEnabled(int command_id) const { 102 bool RenderViewContextMenuImpl::IsCommandIdEnabled(int command_id) const {
103 if (RenderViewContextMenuBase::IsCommandIdEnabled(command_id)) 103 {
104 return true; 104 bool enabled = false;
105 if (RenderViewContextMenuBase::GetCommandIdEnabled(command_id, &enabled))
106 return enabled;
107 }
105 switch (command_id) { 108 switch (command_id) {
106 case CMD_BACK: 109 case CMD_BACK:
107 return source_web_contents_->GetController().CanGoBack(); 110 return source_web_contents_->GetController().CanGoBack();
108 case CMD_FORWARD: 111 case CMD_FORWARD:
109 return source_web_contents_->GetController().CanGoForward(); 112 return source_web_contents_->GetController().CanGoForward();
110 case CMD_RELOAD: 113 case CMD_RELOAD:
111 return true; 114 return true;
112 case CMD_VIEW_SOURCE: 115 case CMD_VIEW_SOURCE:
113 return source_web_contents_->GetController().CanViewSource(); 116 return source_web_contents_->GetController().CanViewSource();
114 } 117 }
(...skipping 16 matching lines...) Expand all
131 case CMD_RELOAD: 134 case CMD_RELOAD:
132 source_web_contents_->GetController().Reload(true); 135 source_web_contents_->GetController().Reload(true);
133 break; 136 break;
134 case CMD_VIEW_SOURCE: 137 case CMD_VIEW_SOURCE:
135 source_web_contents_->ViewSource(); 138 source_web_contents_->ViewSource();
136 break; 139 break;
137 } 140 }
138 } 141 }
139 142
140 } // namespace athena 143 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698