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) |