OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/command_updater.h" | 5 #include "chrome/browser/command_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util.h" |
12 | 12 |
13 CommandUpdater::CommandUpdaterDelegate::~CommandUpdaterDelegate() { | 13 CommandUpdater::CommandUpdaterDelegate::~CommandUpdaterDelegate() { |
14 } | 14 } |
15 | 15 |
16 class CommandUpdater::Command { | 16 class CommandUpdater::Command { |
17 public: | 17 public: |
18 bool enabled; | 18 bool enabled; |
19 ObserverList<CommandObserver> observers; | 19 ObserverList<CommandObserver> observers; |
20 | 20 |
21 Command() : enabled(true) {} | 21 Command() : enabled(true) {} |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 void CommandUpdater::RemoveCommandObserver(CommandObserver* observer) { | 78 void CommandUpdater::RemoveCommandObserver(CommandObserver* observer) { |
79 for (CommandMap::const_iterator it = commands_.begin(); | 79 for (CommandMap::const_iterator it = commands_.begin(); |
80 it != commands_.end(); | 80 it != commands_.end(); |
81 ++it) { | 81 ++it) { |
82 Command* command = it->second; | 82 Command* command = it->second; |
83 if (command) | 83 if (command) |
84 command->observers.RemoveObserver(observer); | 84 command->observers.RemoveObserver(observer); |
85 } | 85 } |
86 } | 86 } |
OLD | NEW |