Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(948)

Unified Diff: ui/app_list/views/app_list_main_view.h

Issue 683703002: Notify launcher page with onTransitionChanged event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_show_state_notify
Patch Set: nullptr like it's 1999 Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/app_list/views/app_list_main_view.h
diff --git a/ui/app_list/views/app_list_main_view.h b/ui/app_list/views/app_list_main_view.h
index a87ae16f213f374064dc64f5e3a245b5d7d25c15..4dc534cb2002f3128592484ca8d74a4707dbf95c 100644
--- a/ui/app_list/views/app_list_main_view.h
+++ b/ui/app_list/views/app_list_main_view.h
@@ -9,6 +9,7 @@
#include "base/memory/scoped_vector.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "base/timer/timer.h"
#include "ui/app_list/app_list_export.h"
#include "ui/app_list/views/apps_grid_view_delegate.h"
@@ -31,6 +32,18 @@ class ContentsView;
class PaginationModel;
class SearchBoxView;
+class AppListMainViewObserver {
+ public:
+ // Invoked after a new contents view is created.
+ virtual void OnContentsViewCreated() {}
+
+ // Invoked before the contens view is destroyed.
+ virtual void OnContentsViewDestroying() {}
+
+ protected:
+ virtual ~AppListMainViewObserver() {}
+};
+
// AppListMainView contains the normal view of the app list, which is shown
// when the user is signed in.
class APP_LIST_EXPORT AppListMainView : public views::View,
@@ -79,6 +92,9 @@ class APP_LIST_EXPORT AppListMainView : public views::View,
// Called when the search box's visibility is changed.
void NotifySearchBoxVisibilityChanged();
+ void AddObserver(AppListMainViewObserver* observer);
+ void RemoveObserver(AppListMainViewObserver* observer);
+
private:
class IconLoader;
@@ -130,6 +146,8 @@ class APP_LIST_EXPORT AppListMainView : public views::View,
base::WeakPtrFactory<AppListMainView> weak_ptr_factory_;
+ ObserverList<AppListMainViewObserver, true> observers_;
+
DISALLOW_COPY_AND_ASSIGN(AppListMainView);
};

Powered by Google App Engine
This is Rietveld 408576698