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

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

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.cc
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index 04585c368782a27e6c39869a996ae77b436ec703..73621985d560816aefae210e82548ff520de7f5c 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -125,6 +125,9 @@ void AppListMainView::AddContentsViews() {
contents_view_->layer()->SetMasksToBounds(true);
delegate_->StartSearch();
+
+ FOR_EACH_OBSERVER(
+ AppListMainViewObserver, observers_, OnContentsViewCreated());
}
void AppListMainView::ShowAppListWhenReady() {
@@ -167,6 +170,10 @@ void AppListMainView::ModelChanged() {
pending_icon_loaders_.clear();
model_ = delegate_->GetModel();
search_box_view_->ModelChanged();
+
+ FOR_EACH_OBSERVER(
+ AppListMainViewObserver, observers_, OnContentsViewDestroying());
+
delete contents_view_;
contents_view_ = NULL;
if (contents_switcher_view_) {
@@ -261,6 +268,14 @@ void AppListMainView::NotifySearchBoxVisibilityChanged() {
parent()->SchedulePaint();
}
+void AppListMainView::AddObserver(AppListMainViewObserver* observer) {
+ observers_.AddObserver(observer);
+}
+
+void AppListMainView::RemoveObserver(AppListMainViewObserver* observer) {
+ observers_.RemoveObserver(observer);
+}
+
void AppListMainView::ActivateApp(AppListItem* item, int event_flags) {
// TODO(jennyz): Activate the folder via AppListModel notification.
if (item->GetItemType() == AppListFolderItem::kItemType)

Powered by Google App Engine
This is Rietveld 408576698