diff options
author | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 15:18:55 +0000 |
---|---|---|
committer | mgiuca@chromium.org <mgiuca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 15:20:40 +0000 |
commit | 9b770aef7f564353654f3eec70e599ece6692955 (patch) | |
tree | c7deea2db2c5e0852b293b0c1436b6351962232f /ui | |
parent | db0f0c91630189937fd7cc627c2e6766fa8783ba (diff) | |
download | chromium_src-9b770aef7f564353654f3eec70e599ece6692955.zip chromium_src-9b770aef7f564353654f3eec70e599ece6692955.tar.gz chromium_src-9b770aef7f564353654f3eec70e599ece6692955.tar.bz2 |
App list: Infrastructure now supports multiple custom launcher pages.
AppListTestViewDelegate::CreateCustomPageWebViews now returns a vector
of views, not a single view. AppListViewDelegate is now able to generate
multiple custom launcher pages which will all be inserted into the
launcher (but currently only ever produces a single one, from the
--custom-launcher-page switch).
BUG=399131
Review URL: https://codereview.chromium.org/441873004
Cr-Commit-Position: refs/heads/master@{#288975}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288975 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app_list/app_list_view_delegate.h | 7 | ||||
-rw-r--r-- | ui/app_list/test/app_list_test_view_delegate.cc | 5 | ||||
-rw-r--r-- | ui/app_list/test/app_list_test_view_delegate.h | 3 | ||||
-rw-r--r-- | ui/app_list/views/contents_view.cc | 13 |
4 files changed, 18 insertions, 10 deletions
diff --git a/ui/app_list/app_list_view_delegate.h b/ui/app_list/app_list_view_delegate.h index 606e218..90a608e 100644 --- a/ui/app_list/app_list_view_delegate.h +++ b/ui/app_list/app_list_view_delegate.h @@ -140,9 +140,10 @@ class APP_LIST_EXPORT AppListViewDelegate { // the returned view. virtual views::View* CreateStartPageWebView(const gfx::Size& size) = 0; - // Creates the web view for the user-specified custom page. May return NULL. - // The caller takes ownership of the returned view. - virtual views::View* CreateCustomPageWebView(const gfx::Size& size) = 0; + // Creates the web views for the user-specified custom pages. The caller takes + // ownership of the returned views. + virtual std::vector<views::View*> CreateCustomPageWebViews( + const gfx::Size& size) = 0; #endif // Returns true if the delegate supports speech recognition. diff --git a/ui/app_list/test/app_list_test_view_delegate.cc b/ui/app_list/test/app_list_test_view_delegate.cc index e4044b4..56c2e8f 100644 --- a/ui/app_list/test/app_list_test_view_delegate.cc +++ b/ui/app_list/test/app_list_test_view_delegate.cc @@ -5,6 +5,7 @@ #include "ui/app_list/test/app_list_test_view_delegate.h" #include <string> +#include <vector> #include "base/callback.h" #include "base/files/file_path.h" @@ -96,9 +97,9 @@ views::View* AppListTestViewDelegate::CreateStartPageWebView( const gfx::Size& size) { return NULL; } -views::View* AppListTestViewDelegate::CreateCustomPageWebView( +std::vector<views::View*> AppListTestViewDelegate::CreateCustomPageWebViews( const gfx::Size& size) { - return NULL; + return std::vector<views::View*>(); } #endif diff --git a/ui/app_list/test/app_list_test_view_delegate.h b/ui/app_list/test/app_list_test_view_delegate.h index acf7130..dac12b7 100644 --- a/ui/app_list/test/app_list_test_view_delegate.h +++ b/ui/app_list/test/app_list_test_view_delegate.h @@ -77,7 +77,8 @@ class AppListTestViewDelegate : public AppListViewDelegate { const base::FilePath& profile_path) OVERRIDE {} #if defined(TOOLKIT_VIEWS) virtual views::View* CreateStartPageWebView(const gfx::Size& size) OVERRIDE; - virtual views::View* CreateCustomPageWebView(const gfx::Size& size) OVERRIDE; + virtual std::vector<views::View*> CreateCustomPageWebViews( + const gfx::Size& size) OVERRIDE; #endif virtual bool IsSpeechRecognitionEnabled() OVERRIDE; virtual const Users& GetUsers() const OVERRIDE; diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc index 9057abc..650115c 100644 --- a/ui/app_list/views/contents_view.cc +++ b/ui/app_list/views/contents_view.cc @@ -5,6 +5,7 @@ #include "ui/app_list/views/contents_view.h" #include <algorithm> +#include <vector> #include "base/logging.h" #include "grit/ui_resources.h" @@ -56,10 +57,14 @@ void ContentsView::InitNamedPages(AppListModel* model, DCHECK(model); if (app_list::switches::IsExperimentalAppListEnabled()) { - views::View* custom_page_view = - view_delegate->CreateCustomPageWebView(GetLocalBounds().size()); - if (custom_page_view) - AddLauncherPage(custom_page_view, IDR_APP_LIST_NOTIFICATIONS_ICON); + std::vector<views::View*> custom_page_views = + view_delegate->CreateCustomPageWebViews(GetLocalBounds().size()); + for (std::vector<views::View*>::const_iterator it = + custom_page_views.begin(); + it != custom_page_views.end(); + ++it) { + AddLauncherPage(*it, IDR_APP_LIST_NOTIFICATIONS_ICON); + } start_page_view_ = new StartPageView(app_list_main_view_, view_delegate); AddLauncherPage( |