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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_controller.mm

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 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 30 matching lines...) Expand all
41 owner_(owner) {} 41 owner_(owner) {}
42 42
43 // Overridden from ui::SimpleMenuModel::Delegate 43 // Overridden from ui::SimpleMenuModel::Delegate
44 bool IsCommandIdChecked(int command_id) const override { return false; } 44 bool IsCommandIdChecked(int command_id) const override { return false; }
45 bool IsCommandIdEnabled(int command_id) const override { 45 bool IsCommandIdEnabled(int command_id) const override {
46 TabStripModel::ContextMenuCommand command = 46 TabStripModel::ContextMenuCommand command =
47 static_cast<TabStripModel::ContextMenuCommand>(command_id); 47 static_cast<TabStripModel::ContextMenuCommand>(command_id);
48 return [target_ isCommandEnabled:command forController:owner_]; 48 return [target_ isCommandEnabled:command forController:owner_];
49 } 49 }
50 bool GetAcceleratorForCommandId(int command_id, 50 bool GetAcceleratorForCommandId(int command_id,
51 ui::Accelerator* accelerator) override { 51 ui::Accelerator* accelerator) const override {
52 return false; 52 return false;
53 } 53 }
54 void ExecuteCommand(int command_id, int event_flags) override { 54 void ExecuteCommand(int command_id, int event_flags) override {
55 TabStripModel::ContextMenuCommand command = 55 TabStripModel::ContextMenuCommand command =
56 static_cast<TabStripModel::ContextMenuCommand>(command_id); 56 static_cast<TabStripModel::ContextMenuCommand>(command_id);
57 [target_ commandDispatch:command forController:owner_]; 57 [target_ commandDispatch:command forController:owner_];
58 } 58 }
59 59
60 private: 60 private:
61 id<TabControllerTarget> target_; // weak 61 id<TabControllerTarget> target_; // weak
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 YES : NO; 467 YES : NO;
468 } 468 }
469 return NO; 469 return NO;
470 } 470 }
471 471
472 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { 472 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab {
473 [[target_ dragController] maybeStartDrag:event forTab:tab]; 473 [[target_ dragController] maybeStartDrag:event forTab:tab];
474 } 474 }
475 475
476 @end 476 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698