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 "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/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 ui::Accelerator* accelerator) { | 146 ui::Accelerator* accelerator) { |
147 NOTIMPLEMENTED(); | 147 NOTIMPLEMENTED(); |
148 return false; | 148 return false; |
149 } | 149 } |
150 | 150 |
151 bool RenderViewContextMenuImpl::IsCommandIdChecked(int command_id) const { | 151 bool RenderViewContextMenuImpl::IsCommandIdChecked(int command_id) const { |
152 return false; | 152 return false; |
153 } | 153 } |
154 | 154 |
155 bool RenderViewContextMenuImpl::IsCommandIdEnabled(int command_id) const { | 155 bool RenderViewContextMenuImpl::IsCommandIdEnabled(int command_id) const { |
156 if (RenderViewContextMenuBase::IsCommandIdEnabled(command_id)) | 156 { |
157 return true; | 157 bool enabled = false; |
| 158 if (RenderViewContextMenuBase::IsCommandIdKnown(command_id, &enabled)) |
| 159 return enabled; |
| 160 } |
158 switch (command_id) { | 161 switch (command_id) { |
159 // Navigation | 162 // Navigation |
160 case CMD_BACK: | 163 case CMD_BACK: |
161 return source_web_contents_->GetController().CanGoBack(); | 164 return source_web_contents_->GetController().CanGoBack(); |
162 case CMD_FORWARD: | 165 case CMD_FORWARD: |
163 return source_web_contents_->GetController().CanGoForward(); | 166 return source_web_contents_->GetController().CanGoForward(); |
164 case CMD_RELOAD: | 167 case CMD_RELOAD: |
165 return true; | 168 return true; |
166 case CMD_VIEW_SOURCE: | 169 case CMD_VIEW_SOURCE: |
167 return source_web_contents_->GetController().CanViewSource(); | 170 return source_web_contents_->GetController().CanViewSource(); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 source_web_contents_->Delete(); | 258 source_web_contents_->Delete(); |
256 break; | 259 break; |
257 | 260 |
258 case CMD_SELECT_ALL: | 261 case CMD_SELECT_ALL: |
259 source_web_contents_->SelectAll(); | 262 source_web_contents_->SelectAll(); |
260 break; | 263 break; |
261 } | 264 } |
262 } | 265 } |
263 | 266 |
264 } // namespace athena | 267 } // namespace athena |
OLD | NEW |