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

Side by Side Diff: content/shell/browser/shell_web_contents_view_delegate_views.cc

Issue 2140963002: Added default implementations of GetAcceleratorForCommandId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@acceleratorprovider-const
Patch Set: Rebase. Created 4 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
« no previous file with comments | « components/translate/core/browser/options_menu_model.cc ('k') | ui/app_list/app_list_menu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/shell/browser/shell_web_contents_view_delegate.h" 5 #include "content/shell/browser/shell_web_contents_view_delegate.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/public/browser/web_contents.h" 8 #include "content/public/browser/web_contents.h"
9 #include "content/shell/browser/shell_devtools_frontend.h" 9 #include "content/shell/browser/shell_devtools_frontend.h"
10 #include "content/shell/common/shell_switches.h" 10 #include "content/shell/common/shell_switches.h"
(...skipping 14 matching lines...) Expand all
25 : ui::SimpleMenuModel(this), 25 : ui::SimpleMenuModel(this),
26 web_contents_(web_contents), 26 web_contents_(web_contents),
27 params_(params) { 27 params_(params) {
28 AddItem(COMMAND_OPEN_DEVTOOLS, base::ASCIIToUTF16("Inspect Element")); 28 AddItem(COMMAND_OPEN_DEVTOOLS, base::ASCIIToUTF16("Inspect Element"));
29 } 29 }
30 ~ContextMenuModel() override {} 30 ~ContextMenuModel() override {}
31 31
32 // ui::SimpleMenuModel::Delegate: 32 // ui::SimpleMenuModel::Delegate:
33 bool IsCommandIdChecked(int command_id) const override { return false; } 33 bool IsCommandIdChecked(int command_id) const override { return false; }
34 bool IsCommandIdEnabled(int command_id) const override { return true; } 34 bool IsCommandIdEnabled(int command_id) const override { return true; }
35 bool GetAcceleratorForCommandId(int command_id,
36 ui::Accelerator* accelerator) const override {
37 return false;
38 }
39 void ExecuteCommand(int command_id, int event_flags) override { 35 void ExecuteCommand(int command_id, int event_flags) override {
40 switch (command_id) { 36 switch (command_id) {
41 case COMMAND_OPEN_DEVTOOLS: 37 case COMMAND_OPEN_DEVTOOLS:
42 ShellDevToolsFrontend* devtools_frontend = 38 ShellDevToolsFrontend* devtools_frontend =
43 ShellDevToolsFrontend::Show(web_contents_); 39 ShellDevToolsFrontend::Show(web_contents_);
44 devtools_frontend->Activate(); 40 devtools_frontend->Activate();
45 devtools_frontend->Focus(); 41 devtools_frontend->Focus();
46 devtools_frontend->InspectElementAt(params_.x, params_.y); 42 devtools_frontend->InspectElementAt(params_.x, params_.y);
47 break; 43 break;
48 }; 44 };
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 web_contents_->GetTopLevelNativeWindow()); 93 web_contents_->GetTopLevelNativeWindow());
98 if (context_menu_runner_->RunMenuAt( 94 if (context_menu_runner_->RunMenuAt(
99 widget, nullptr, gfx::Rect(screen_point, gfx::Size()), 95 widget, nullptr, gfx::Rect(screen_point, gfx::Size()),
100 views::MENU_ANCHOR_TOPRIGHT, 96 views::MENU_ANCHOR_TOPRIGHT,
101 ui::MENU_SOURCE_NONE) == views::MenuRunner::MENU_DELETED) { 97 ui::MENU_SOURCE_NONE) == views::MenuRunner::MENU_DELETED) {
102 return; 98 return;
103 } 99 }
104 } 100 }
105 101
106 } // namespace content 102 } // namespace content
OLDNEW
« no previous file with comments | « components/translate/core/browser/options_menu_model.cc ('k') | ui/app_list/app_list_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698