| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "chrome/browser/command_updater.h" | 7 #include "chrome/browser/command_updater.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/common/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| 11 | 11 |
| 12 CommandUpdater::CommandUpdater(CommandUpdaterDelegate* handler) | 12 CommandUpdater::CommandUpdater(CommandUpdaterDelegate* handler) |
| 13 : delegate_(handler) { | 13 : delegate_(handler) { |
| 14 } | 14 } |
| 15 | 15 |
| 16 CommandUpdater::~CommandUpdater() { | 16 CommandUpdater::~CommandUpdater() { |
| 17 STLDeleteContainerPairSecondPointers(commands_.begin(), commands_.end()); | 17 STLDeleteContainerPairSecondPointers(commands_.begin(), commands_.end()); |
| 18 } | 18 } |
| 19 | 19 |
| 20 bool CommandUpdater::IsCommandEnabled(int id) const { | 20 bool CommandUpdater::IsCommandEnabled(int id) const { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void CommandUpdater::RemoveCommandObserver(CommandObserver* observer) { | 63 void CommandUpdater::RemoveCommandObserver(CommandObserver* observer) { |
| 64 for (CommandMap::const_iterator it = commands_.begin(); | 64 for (CommandMap::const_iterator it = commands_.begin(); |
| 65 it != commands_.end(); | 65 it != commands_.end(); |
| 66 ++it) { | 66 ++it) { |
| 67 Command* command = it->second; | 67 Command* command = it->second; |
| 68 if (command) | 68 if (command) |
| 69 command->observers.RemoveObserver(observer); | 69 command->observers.RemoveObserver(observer); |
| 70 } | 70 } |
| 71 } | 71 } |
| OLD | NEW |