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

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

Issue 2133013002: AcceleratorProvider: Make GetAcceleratorForCommandId const. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix overrides on Mac and Chrome OS. Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/task_runner_util.h" 9 #include "base/task_runner_util.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 // Overridden from ui::SimpleMenuModel::Delegate: 127 // Overridden from ui::SimpleMenuModel::Delegate:
128 bool IsCommandIdChecked(int command_id) const override { return false; } 128 bool IsCommandIdChecked(int command_id) const override { return false; }
129 bool IsCommandIdEnabled(int command_id) const override { 129 bool IsCommandIdEnabled(int command_id) const override {
130 return controller_->IsCommandEnabledForTab( 130 return controller_->IsCommandEnabledForTab(
131 static_cast<TabStripModel::ContextMenuCommand>(command_id), 131 static_cast<TabStripModel::ContextMenuCommand>(command_id),
132 tab_); 132 tab_);
133 } 133 }
134 bool GetAcceleratorForCommandId(int command_id, 134 bool GetAcceleratorForCommandId(int command_id,
135 ui::Accelerator* accelerator) override { 135 ui::Accelerator* accelerator) const override {
136 int browser_cmd; 136 int browser_cmd;
137 return TabStripModel::ContextMenuCommandToBrowserCommand(command_id, 137 return TabStripModel::ContextMenuCommandToBrowserCommand(command_id,
138 &browser_cmd) ? 138 &browser_cmd) ?
139 controller_->tabstrip_->GetWidget()->GetAccelerator(browser_cmd, 139 controller_->tabstrip_->GetWidget()->GetAccelerator(browser_cmd,
140 accelerator) : 140 accelerator) :
141 false; 141 false;
142 } 142 }
143 void CommandIdHighlighted(int command_id) override { 143 void CommandIdHighlighted(int command_id) override {
144 controller_->StopHighlightTabsForCommand(last_command_, tab_); 144 controller_->StopHighlightTabsForCommand(last_command_, tab_);
145 last_command_ = static_cast<TabStripModel::ContextMenuCommand>(command_id); 145 last_command_ = static_cast<TabStripModel::ContextMenuCommand>(command_id);
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 content::WebPluginInfo plugin; 571 content::WebPluginInfo plugin;
572 tabstrip_->FileSupported( 572 tabstrip_->FileSupported(
573 url, 573 url,
574 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || 574 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) ||
575 content::PluginService::GetInstance()->GetPluginInfo( 575 content::PluginService::GetInstance()->GetPluginInfo(
576 -1, // process ID 576 -1, // process ID
577 MSG_ROUTING_NONE, // routing ID 577 MSG_ROUTING_NONE, // routing ID
578 model_->profile()->GetResourceContext(), url, GURL(), mime_type, 578 model_->profile()->GetResourceContext(), url, GURL(), mime_type,
579 false, NULL, &plugin, NULL)); 579 false, NULL, &plugin, NULL));
580 } 580 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698