| 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" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 bool ShouldAddExtension(const extensions::Extension* extension); | 251 bool ShouldAddExtension(const extensions::Extension* extension); |
| 252 | 252 |
| 253 // Adds or removes the given |extension| from the toolbar model. | 253 // Adds or removes the given |extension| from the toolbar model. |
| 254 void AddExtension(const extensions::Extension* extension); | 254 void AddExtension(const extensions::Extension* extension); |
| 255 void RemoveExtension(const extensions::Extension* extension); | 255 void RemoveExtension(const extensions::Extension* extension); |
| 256 | 256 |
| 257 // Returns true if |item| is in the toolbar model. | 257 // Returns true if |item| is in the toolbar model. |
| 258 bool HasItem(const ToolbarItem& item) const; | 258 bool HasItem(const ToolbarItem& item) const; |
| 259 | 259 |
| 260 // Adds |item| to the toolbar. If the item has an existing preference for | 260 // Adds |item| to the toolbar. If the item has an existing preference for |
| 261 // toolbar position, that will be used to determine its location. If | 261 // toolbar position, that will be used to determine its location. Otherwise |
| 262 // |is_component| is true, the item will be given a default postion of 0, | 262 // it will be placed at the end of the visible items. If the toolbar is in |
| 263 // otherwise the default is at the end of the visible items. If the toolbar is | 263 // highlighting mode, the item will not be visible until highlighting mode is |
| 264 // in highlighting mode, the item will not be visible until highlighting mode | 264 // exited. |
| 265 // is exited. | 265 void AddItem(const ToolbarItem& item); |
| 266 void AddItem(const ToolbarItem& item, bool is_component); | |
| 267 | 266 |
| 268 // Removes |item| from the toolbar. If the toolbar is in highlighting mode, | 267 // Removes |item| from the toolbar. If the toolbar is in highlighting mode, |
| 269 // the item is also removed from the highlighted list (if present). | 268 // the item is also removed from the highlighted list (if present). |
| 270 void RemoveItem(const ToolbarItem& item); | 269 void RemoveItem(const ToolbarItem& item); |
| 271 | 270 |
| 272 // Looks up and returns the extension with the given |id| in the set of | 271 // Looks up and returns the extension with the given |id| in the set of |
| 273 // enabled extensions. | 272 // enabled extensions. |
| 274 const extensions::Extension* GetExtensionById(const std::string& id) const; | 273 const extensions::Extension* GetExtensionById(const std::string& id) const; |
| 275 | 274 |
| 276 // Our observers. | 275 // Our observers. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // For observing change of toolbar order preference by external entity (sync). | 337 // For observing change of toolbar order preference by external entity (sync). |
| 339 PrefChangeRegistrar pref_change_registrar_; | 338 PrefChangeRegistrar pref_change_registrar_; |
| 340 base::Closure pref_change_callback_; | 339 base::Closure pref_change_callback_; |
| 341 | 340 |
| 342 base::WeakPtrFactory<ToolbarActionsModel> weak_ptr_factory_; | 341 base::WeakPtrFactory<ToolbarActionsModel> weak_ptr_factory_; |
| 343 | 342 |
| 344 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsModel); | 343 DISALLOW_COPY_AND_ASSIGN(ToolbarActionsModel); |
| 345 }; | 344 }; |
| 346 | 345 |
| 347 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ | 346 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_ACTIONS_MODEL_H_ |
| OLD | NEW |