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

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

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
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 29 matching lines...) Expand all
40 : target_(target), 40 : target_(target),
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,
51 ui::Accelerator* accelerator) const override {
52 return false;
53 }
54 void ExecuteCommand(int command_id, int event_flags) override { 50 void ExecuteCommand(int command_id, int event_flags) override {
55 TabStripModel::ContextMenuCommand command = 51 TabStripModel::ContextMenuCommand command =
56 static_cast<TabStripModel::ContextMenuCommand>(command_id); 52 static_cast<TabStripModel::ContextMenuCommand>(command_id);
57 [target_ commandDispatch:command forController:owner_]; 53 [target_ commandDispatch:command forController:owner_];
58 } 54 }
59 55
60 private: 56 private:
61 id<TabControllerTarget> target_; // weak 57 id<TabControllerTarget> target_; // weak
62 TabController* owner_; // weak, owns me 58 TabController* owner_; // weak, owns me
63 }; 59 };
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 YES : NO; 463 YES : NO;
468 } 464 }
469 return NO; 465 return NO;
470 } 466 }
471 467
472 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab { 468 - (void)maybeStartDrag:(NSEvent*)event forTab:(TabController*)tab {
473 [[target_ dragController] maybeStartDrag:event forTab:tab]; 469 [[target_ dragController] maybeStartDrag:event forTab:tab];
474 } 470 }
475 471
476 @end 472 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698