| 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..242129e25ef8935ed74f2303a95353aadc4d75cf 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,40 +26,24 @@ 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);
|
| -
|
| - // 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_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(LauncherModel);
|
|
|