diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-19 18:10:49 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-19 18:10:49 +0000 |
commit | c2a7429976443bbca712e9e23012f32416a980de (patch) | |
tree | dd3bd8c6bef622f300638470439ecf8e7959a209 /ash/shell | |
parent | b645bd4b8f85f9a059b42bd4f85f37ddd987bc02 (diff) | |
download | chromium_src-c2a7429976443bbca712e9e23012f32416a980de.zip chromium_src-c2a7429976443bbca712e9e23012f32416a980de.tar.gz chromium_src-c2a7429976443bbca712e9e23012f32416a980de.tar.bz2 |
Introduce AppListSyncableService, owns AppListModel and builder
This introduces AppListSyncableService, but does not implement any
syncing yet. The purpose is to move ownership of AppListModel so that
we can maintain and sync the model state independent of the view. It also
made sense to move ExtensionAppModelBuilder ownership to
AppListSyncableService.
This required a fair bit of (smallish) re-factoring. Here is a simplified
diagram that may help:
https://docs.google.com/a/google.com/drawings/d/1NgaQzdqddTh1W7altZ6P6t4dNxZDRO0e_HgJqa8V36A/edit
BUG=315887
For minor ash/shell/ changes:
R=jennyz@chromium.org, tapted@chromium.org, xiyuan@chromium.org
TBR=jamescook@chromium.org
Review URL: https://codereview.chromium.org/66023003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell')
-rw-r--r-- | ash/shell/app_list.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc index 49eb4f4..07f888e 100644 --- a/ash/shell/app_list.cc +++ b/ash/shell/app_list.cc @@ -194,7 +194,11 @@ class ExampleSearchResult : public app_list::SearchResult { class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { public: - ExampleAppListViewDelegate() : model_(NULL) {} + ExampleAppListViewDelegate() + : model_(new app_list::AppListModel) { + PopulateApps(model_->item_list()); + DecorateSearchBox(model_->search_box()); + } private: void PopulateApps(app_list::AppListItemList* item_list) { @@ -241,11 +245,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { return users_; } - virtual void InitModel(app_list::AppListModel* model) OVERRIDE { - model_ = model; - PopulateApps(model_->item_list()); - DecorateSearchBox(model_->search_box()); - } + virtual app_list::AppListModel* GetModel() OVERRIDE { return model_.get(); } virtual app_list::SigninDelegate* GetSigninDelegate() OVERRIDE { return NULL; @@ -254,6 +254,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { virtual void GetShortcutPathForApp( const std::string& app_id, const base::Callback<void(const base::FilePath&)>& callback) OVERRIDE { + callback.Run(base::FilePath()); } virtual void OpenSearchResult(app_list::SearchResult* result, @@ -336,7 +337,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate { return NULL; } - app_list::AppListModel* model_; + scoped_ptr<app_list::AppListModel> model_; Users users_; DISALLOW_COPY_AND_ASSIGN(ExampleAppListViewDelegate); |