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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_vector.h" | |
13 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
14 #include "base/scoped_observer.h" | 13 #include "base/scoped_observer.h" |
15 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 14 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
16 #include "chrome/browser/extensions/component_migration_helper.h" | 15 #include "chrome/browser/extensions/component_migration_helper.h" |
17 #include "chrome/browser/extensions/extension_action.h" | 16 #include "chrome/browser/extensions/extension_action.h" |
18 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
19 #include "components/prefs/pref_change_registrar.h" | 18 #include "components/prefs/pref_change_registrar.h" |
20 #include "extensions/browser/extension_prefs.h" | 19 #include "extensions/browser/extension_prefs.h" |
21 #include "extensions/browser/extension_registry_observer.h" | 20 #include "extensions/browser/extension_registry_observer.h" |
22 #include "extensions/common/extension.h" | 21 #include "extensions/common/extension.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 ? toolbar_items().size() | 144 ? toolbar_items().size() |
146 : std::min(static_cast<size_t>(visible_icon_count_), | 145 : std::min(static_cast<size_t>(visible_icon_count_), |
147 toolbar_items().size()); | 146 toolbar_items().size()); |
148 } | 147 } |
149 bool all_icons_visible() const { | 148 bool all_icons_visible() const { |
150 return visible_icon_count() == toolbar_items().size(); | 149 return visible_icon_count() == toolbar_items().size(); |
151 } | 150 } |
152 | 151 |
153 bool actions_initialized() const { return actions_initialized_; } | 152 bool actions_initialized() const { return actions_initialized_; } |
154 | 153 |
155 ScopedVector<ToolbarActionViewController> CreateActions( | 154 std::vector<std::unique_ptr<ToolbarActionViewController>> CreateActions( |
156 Browser* browser, | 155 Browser* browser, |
157 ToolbarActionsBar* bar); | 156 ToolbarActionsBar* bar); |
158 std::unique_ptr<ToolbarActionViewController> CreateActionForItem( | 157 std::unique_ptr<ToolbarActionViewController> CreateActionForItem( |
159 Browser* browser, | 158 Browser* browser, |
160 ToolbarActionsBar* bar, | 159 ToolbarActionsBar* bar, |
161 const ToolbarItem& item); | 160 const ToolbarItem& item); |
162 | 161 |
163 const std::vector<ToolbarItem>& toolbar_items() const { | 162 const std::vector<ToolbarItem>& toolbar_items() const { |
164 return is_highlighting() ? highlighted_items_ : toolbar_items_; | 163 return is_highlighting() ? highlighted_items_ : toolbar_items_; |
165 } | 164 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 // For observing change of toolbar order preference by external entity (sync). | 338 // For observing change of toolbar order preference by external entity (sync). |
340 PrefChangeRegistrar pref_change_registrar_; | 339 PrefChangeRegistrar pref_change_registrar_; |
341 base::Closure pref_change_callback_; | 340 base::Closure pref_change_callback_; |
342 | 341 |
343 base::WeakPtrFactory<ToolbarActionsModel> weak_ptr_factory_; | 342 base::WeakPtrFactory<ToolbarActionsModel> weak_ptr_factory_; |
344 | 343 |
345 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsModel); | 344 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsModel); |
346 }; | 345 }; |
347 | 346 |
348 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ | 347 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ |
OLD | NEW |