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

Side by Side Diff: chrome/browser/ui/cocoa/command_observer_bridge.mm

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/command_observer_bridge.h" 5 #import "chrome/browser/ui/cocoa/command_observer_bridge.h"
6 #include "chrome/browser/command_updater.h"
6 7
7 #include "base/logging.h" 8 #include "base/logging.h"
8 9
9 CommandObserverBridge::CommandObserverBridge( 10 CommandObserverBridge::CommandObserverBridge(
10 id<CommandObserverProtocol> observer, CommandUpdater* commands) 11 id<CommandObserverProtocol> observer, CommandUpdater* commands)
11 : observer_(observer), commands_(commands) { 12 : observer_(observer), commands_(commands) {
12 DCHECK(observer_ && commands_); 13 DCHECK(observer_ && commands_);
13 } 14 }
14 15
15 CommandObserverBridge::~CommandObserverBridge() { 16 CommandObserverBridge::~CommandObserverBridge() {
16 // Unregister the notifications 17 // Unregister the notifications
17 commands_->RemoveCommandObserver(this); 18 commands_->RemoveCommandObserver(this);
18 } 19 }
19 20
20 void CommandObserverBridge::ObserveCommand(int command) { 21 void CommandObserverBridge::ObserveCommand(int command) {
21 commands_->AddCommandObserver(command, this); 22 commands_->AddCommandObserver(command, this);
22 } 23 }
23 24
24 void CommandObserverBridge::EnabledStateChangedForCommand(int command, 25 void CommandObserverBridge::EnabledStateChangedForCommand(int command,
25 bool enabled) { 26 bool enabled) {
26 [observer_ enabledStateChangedForCommand:command 27 [observer_ enabledStateChangedForCommand:command
27 enabled:enabled ? YES : NO]; 28 enabled:enabled ? YES : NO];
28 } 29 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/command_observer_bridge.h ('k') | chrome/browser/ui/cocoa/command_observer_bridge_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698