OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/cocoa/command_observer_bridge.h" |
| 6 |
| 7 CommandObserverBridge::CommandObserverBridge( |
| 8 id<CommandObserverProtocol> observer, CommandUpdater* commands) |
| 9 : observer_(observer), commands_(commands) { |
| 10 DCHECK(observer_ && commands_); |
| 11 } |
| 12 |
| 13 CommandObserverBridge::~CommandObserverBridge() { |
| 14 // Unregister the notifications |
| 15 commands_->RemoveCommandObserver(this); |
| 16 } |
| 17 |
| 18 void CommandObserverBridge::ObserveCommand(int command) { |
| 19 commands_->AddCommandObserver(command, this); |
| 20 } |
| 21 |
| 22 void CommandObserverBridge::EnabledStateChangedForCommand(int command, |
| 23 bool enabled) { |
| 24 [observer_ enabledStateChangedForCommand:command |
| 25 enabled:enabled ? YES : NO]; |
| 26 } |
OLD | NEW |