OLD | NEW |
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 #ifndef CHROME_BROWSER_COMMAND_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_COMMAND_UPDATER_H_ |
6 #define CHROME_BROWSER_COMMAND_UPDATER_H_ | 6 #define CHROME_BROWSER_COMMAND_UPDATER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "ui/base/window_open_disposition.h" | 12 #include "ui/base/window_open_disposition.h" |
11 | 13 |
12 class CommandObserver; | 14 class CommandObserver; |
13 class CommandUpdaterDelegate; | 15 class CommandUpdaterDelegate; |
14 | 16 |
15 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
16 // | 18 // |
17 // CommandUpdater class | 19 // CommandUpdater class |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 class Command; | 70 class Command; |
69 | 71 |
70 // Get a Command node for a given command ID, creating an entry if it doesn't | 72 // Get a Command node for a given command ID, creating an entry if it doesn't |
71 // exist if desired. | 73 // exist if desired. |
72 Command* GetCommand(int id, bool create); | 74 Command* GetCommand(int id, bool create); |
73 | 75 |
74 // The delegate is responsible for executing commands. | 76 // The delegate is responsible for executing commands. |
75 CommandUpdaterDelegate* delegate_; | 77 CommandUpdaterDelegate* delegate_; |
76 | 78 |
77 // This is a map of command IDs to states and observer lists | 79 // This is a map of command IDs to states and observer lists |
78 typedef base::hash_map<int, Command*> CommandMap; | 80 base::hash_map<int, std::unique_ptr<Command>> commands_; |
79 CommandMap commands_; | |
80 | 81 |
81 DISALLOW_COPY_AND_ASSIGN(CommandUpdater); | 82 DISALLOW_COPY_AND_ASSIGN(CommandUpdater); |
82 }; | 83 }; |
83 | 84 |
84 #endif // CHROME_BROWSER_COMMAND_UPDATER_H_ | 85 #endif // CHROME_BROWSER_COMMAND_UPDATER_H_ |
OLD | NEW |