| 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_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // The different types of actions. | 49 // The different types of actions. |
| 50 enum ActionType { | 50 enum ActionType { |
| 51 UNKNOWN_ACTION, | 51 UNKNOWN_ACTION, |
| 52 COMPONENT_ACTION, | 52 COMPONENT_ACTION, |
| 53 EXTENSION_ACTION, | 53 EXTENSION_ACTION, |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 // An action id and its corresponding ActionType. | 56 // An action id and its corresponding ActionType. |
| 57 struct ToolbarItem { | 57 struct ToolbarItem { |
| 58 ToolbarItem() : type(UNKNOWN_ACTION) {} | 58 ToolbarItem() : type(UNKNOWN_ACTION) {} |
| 59 ToolbarItem(std::string action_id, ActionType action_type) | 59 ToolbarItem(const std::string& action_id, ActionType action_type) |
| 60 : id(action_id), type(action_type) {} | 60 : id(action_id), type(action_type) {} |
| 61 | 61 |
| 62 bool operator==(const ToolbarItem& other) { return other.id == id; } | 62 bool operator==(const ToolbarItem& other) { return other.id == id; } |
| 63 | 63 |
| 64 std::string id; | 64 std::string id; |
| 65 ActionType type; | 65 ActionType type; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 ToolbarActionsModel(Profile* profile, | 68 ToolbarActionsModel(Profile* profile, |
| 69 extensions::ExtensionPrefs* extension_prefs); | 69 extensions::ExtensionPrefs* extension_prefs); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // For observing change of toolbar order preference by external entity (sync). | 287 // For observing change of toolbar order preference by external entity (sync). |
| 288 PrefChangeRegistrar pref_change_registrar_; | 288 PrefChangeRegistrar pref_change_registrar_; |
| 289 base::Closure pref_change_callback_; | 289 base::Closure pref_change_callback_; |
| 290 | 290 |
| 291 base::WeakPtrFactory<ToolbarActionsModel> weak_ptr_factory_; | 291 base::WeakPtrFactory<ToolbarActionsModel> weak_ptr_factory_; |
| 292 | 292 |
| 293 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsModel); | 293 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsModel); |
| 294 }; | 294 }; |
| 295 | 295 |
| 296 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ | 296 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ |
| OLD | NEW |