Chromium Code Reviews| Index: ui/app_list/app_list_view_delegate.h |
| diff --git a/ui/app_list/app_list_view_delegate.h b/ui/app_list/app_list_view_delegate.h |
| index 4da51a67ee6384eaf72e0c08d0e2ce47b4af2744..fb98a736f8e1925075e5ed7513b204d027d22db5 100644 |
| --- a/ui/app_list/app_list_view_delegate.h |
| +++ b/ui/app_list/app_list_view_delegate.h |
| @@ -10,6 +10,7 @@ |
| #include "base/callback_forward.h" |
| #include "base/files/file_path.h" |
| +#include "base/observer_list.h" |
| #include "base/strings/string16.h" |
| #include "ui/app_list/app_list_export.h" |
| @@ -29,6 +30,7 @@ namespace app_list { |
| class AppListItemModel; |
| class AppListModel; |
| +class AppListViewDelegateObserver; |
| class SearchResult; |
| class SigninDelegate; |
| @@ -53,6 +55,8 @@ class APP_LIST_EXPORT AppListViewDelegate { |
| }; |
| typedef std::vector<User> Users; |
| + AppListViewDelegate() {} |
|
tapted
2013/11/22 00:03:19
heads-up clang will probably complain about this a
|
| + |
| // AppListView owns the delegate. |
| virtual ~AppListViewDelegate() {} |
| @@ -123,7 +127,19 @@ class APP_LIST_EXPORT AppListViewDelegate { |
| virtual content::WebContents* GetStartPageContents() = 0; |
| // Returns the list of users (for AppListMenu). |
| - virtual const Users& GetUsers() const = 0; |
| + const Users& GetUsers() const; |
| + |
| + void AddObserver(AppListViewDelegateObserver* observer); |
| + void RemoveObserver(AppListViewDelegateObserver* observer); |
| + |
| + protected: |
| + void NotifyUsersChanged(); |
| + |
| + Users users_; |
| + ObserverList<AppListViewDelegateObserver> observers_; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(AppListViewDelegate); |
| }; |
| } // namespace app_list |