| 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/ui/views/renderer_context_menu/render_view_context_menu
_views.h" | 5 #include "chrome/browser/ui/views/renderer_context_menu/render_view_context_menu
_views.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 return true; | 100 return true; |
| 101 | 101 |
| 102 case IDC_CONTENT_CONTEXT_ROTATECW: | 102 case IDC_CONTENT_CONTEXT_ROTATECW: |
| 103 *accel = ui::Accelerator(ui::VKEY_OEM_6, ui::EF_CONTROL_DOWN); | 103 *accel = ui::Accelerator(ui::VKEY_OEM_6, ui::EF_CONTROL_DOWN); |
| 104 return true; | 104 return true; |
| 105 | 105 |
| 106 case IDC_PRINT: | 106 case IDC_PRINT: |
| 107 *accel = ui::Accelerator(ui::VKEY_P, ui::EF_CONTROL_DOWN); | 107 *accel = ui::Accelerator(ui::VKEY_P, ui::EF_CONTROL_DOWN); |
| 108 return true; | 108 return true; |
| 109 | 109 |
| 110 case IDC_RELOAD: |
| 111 *accel = ui::Accelerator(ui::VKEY_R, ui::EF_CONTROL_DOWN); |
| 112 return true; |
| 113 |
| 114 case IDC_VIEW_SOURCE: |
| 115 *accel = ui::Accelerator(ui::VKEY_U, ui::EF_CONTROL_DOWN); |
| 116 return true; |
| 117 |
| 110 default: | 118 default: |
| 111 return false; | 119 return false; |
| 112 } | 120 } |
| 113 } | 121 } |
| 114 | 122 |
| 115 void RenderViewContextMenuViews::ExecuteCommand(int command_id, | 123 void RenderViewContextMenuViews::ExecuteCommand(int command_id, |
| 116 int event_flags) { | 124 int event_flags) { |
| 117 switch (command_id) { | 125 switch (command_id) { |
| 118 case IDC_WRITING_DIRECTION_DEFAULT: | 126 case IDC_WRITING_DIRECTION_DEFAULT: |
| 119 // WebKit's current behavior is for this menu item to always be disabled. | 127 // WebKit's current behavior is for this menu item to always be disabled. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 WebContents::FromRenderFrameHost(GetRenderFrameHost()); | 234 WebContents::FromRenderFrameHost(GetRenderFrameHost()); |
| 227 if (!web_contents) { | 235 if (!web_contents) { |
| 228 LOG(ERROR) << "RenderViewContextMenuViews::Show, couldn't find WebContents"; | 236 LOG(ERROR) << "RenderViewContextMenuViews::Show, couldn't find WebContents"; |
| 229 return NULL; | 237 return NULL; |
| 230 } | 238 } |
| 231 return web_contents->GetFullscreenRenderWidgetHostView() | 239 return web_contents->GetFullscreenRenderWidgetHostView() |
| 232 ? web_contents->GetFullscreenRenderWidgetHostView() | 240 ? web_contents->GetFullscreenRenderWidgetHostView() |
| 233 ->GetNativeView() | 241 ->GetNativeView() |
| 234 : web_contents->GetNativeView(); | 242 : web_contents->GetNativeView(); |
| 235 } | 243 } |
| OLD | NEW |