Chromium Code Reviews| Index: ui/aura_shell/launcher/launcher_model.h |
| diff --git a/ui/aura_shell/launcher/launcher_model.h b/ui/aura_shell/launcher/launcher_model.h |
| index 9aac41c09577bd19fd36100a354e537a66334dfa..f5399c7c1c890e871aa4107daaaa54a45c2bfd9b 100644 |
| --- a/ui/aura_shell/launcher/launcher_model.h |
| +++ b/ui/aura_shell/launcher/launcher_model.h |
| @@ -10,6 +10,7 @@ |
| #include "base/observer_list.h" |
| #include "ui/aura_shell/aura_shell_export.h" |
| +#include "ui/aura_shell/launcher/launcher_types.h" |
| namespace views { |
| class View; |
| @@ -25,42 +26,30 @@ class AURA_SHELL_EXPORT LauncherModel { |
| LauncherModel(); |
| ~LauncherModel(); |
| - // Adds a new view to the model. The model takes ownership of the view. |
| - void AddItem(views::View* view, int index, bool draggable); |
| + static LauncherModel* instance() { return instance_; } |
| - // Removes an item by the view. |
| - void RemoveItem(views::View* view); |
| + // Adds a new item to the model. |
| + void Add(int index, const LauncherItem& item); |
| // Removes the item at |index|. |
| void RemoveItemAt(int index); |
| - // The selected index; -1 if nothing is selected. |
| - void SetSelectedIndex(int index); |
| - int selected_index() const { return selected_index_; } |
| + // Changes the images of the specified item. |
| + void SetTabbedImages(int index, const LauncherTabbedImages& images); |
| + void SetAppImage(int index, const SkBitmap& image); |
| - // Returns the index of |view|, or -1 if view isn't contained in this model. |
| - int IndexOfItemByView(views::View* view); |
| + const LauncherItems& items() const { return items_; } |
| int item_count() const { return static_cast<int>(items_.size()); } |
| - views::View* view_at(int index) { return items_[index].view; } |
| - bool is_draggable(int index) { return items_[index].draggable; } |
| void AddObserver(LauncherModelObserver* observer); |
| void RemoveObserver(LauncherModelObserver* observer); |
| private: |
| - struct Item { |
| - Item() : view(NULL), draggable(false) {} |
| - |
| - // The view, we own this. |
| - views::View* view; |
| - bool draggable; |
| - }; |
| - typedef std::vector<Item> Items; |
| - |
| - Items items_; |
| - int selected_index_; |
| + LauncherItems items_; |
| ObserverList<LauncherModelObserver> observers_; |
| + static LauncherModel* instance_; |
|
Ben Goodger (Google)
2011/10/13 03:03:39
I'm not sure you'll want this to be global like th
|
| + |
| DISALLOW_COPY_AND_ASSIGN(LauncherModel); |
| }; |