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

Unified Diff: ash/shell/shell_delegate_impl.cc

Issue 1861013004: AppListController refactoring part 3: Switching over to use AppListShower in Ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mus_chrome_delegates_ash_impl
Patch Set: Rebase. Created 4 years, 8 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
« no previous file with comments | « ash/shell/shell_delegate_impl.h ('k') | ash/shell_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell/shell_delegate_impl.cc
diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc
index 45e8acbcf33180ffa96bdf9e38a7639292073aed..0671bf6127a44c63770e1637c717ac388ef29887 100644
--- a/ash/shell/shell_delegate_impl.cc
+++ b/ash/shell/shell_delegate_impl.cc
@@ -5,6 +5,8 @@
#include "ash/shell/shell_delegate_impl.h"
#include "ash/accessibility_delegate.h"
+#include "ash/app_list/app_list_shower_delegate_factory.h"
+#include "ash/app_list/app_list_view_delegate_factory.h"
#include "ash/default_accessibility_delegate.h"
#include "ash/default_user_wallpaper_delegate.h"
#include "ash/gpu_support_stub.h"
@@ -19,10 +21,12 @@
#include "ash/system/tray/default_system_tray_delegate.h"
#include "ash/test/test_keyboard_ui.h"
#include "ash/wm/window_state.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "components/user_manager/user_info_impl.h"
#include "ui/app_list/app_list_view_delegate.h"
+#include "ui/app_list/shower/app_list_shower_impl.h"
#include "ui/aura/window.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
@@ -134,9 +138,30 @@ class SessionStateDelegateImpl : public SessionStateDelegate {
DISALLOW_COPY_AND_ASSIGN(SessionStateDelegateImpl);
};
+class AppListViewDelegateFactoryImpl : public ash::AppListViewDelegateFactory {
+ public:
+ AppListViewDelegateFactoryImpl() {}
+ ~AppListViewDelegateFactoryImpl() override {}
+
+ // app_list::AppListViewDelegateFactory:
+ app_list::AppListViewDelegate* GetDelegate() override {
+ if (!app_list_view_delegate_.get())
+ app_list_view_delegate_.reset(CreateAppListViewDelegate());
+ return app_list_view_delegate_.get();
+ }
+
+ private:
+ std::unique_ptr<app_list::AppListViewDelegate> app_list_view_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppListViewDelegateFactoryImpl);
+};
+
} // namespace
-ShellDelegateImpl::ShellDelegateImpl() : shelf_delegate_(nullptr) {}
+ShellDelegateImpl::ShellDelegateImpl()
+ : shelf_delegate_(nullptr),
+ app_list_shower_delegate_factory_(new AppListShowerDelegateFactory(
+ base::WrapUnique(new AppListViewDelegateFactoryImpl))) {}
ShellDelegateImpl::~ShellDelegateImpl() {}
@@ -191,10 +216,12 @@ void ShellDelegateImpl::RemoveVirtualKeyboardStateObserver(
void ShellDelegateImpl::OpenUrl(const GURL& url) {}
-app_list::AppListViewDelegate* ShellDelegateImpl::GetAppListViewDelegate() {
- if (!app_list_view_delegate_)
- app_list_view_delegate_.reset(ash::shell::CreateAppListViewDelegate());
- return app_list_view_delegate_.get();
+app_list::AppListShower* ShellDelegateImpl::GetAppListShower() {
+ if (!app_list_shower_) {
+ app_list_shower_.reset(new app_list::AppListShowerImpl(
+ app_list_shower_delegate_factory_.get()));
+ }
+ return app_list_shower_.get();
}
ShelfDelegate* ShellDelegateImpl::CreateShelfDelegate(ShelfModel* model) {
« no previous file with comments | « ash/shell/shell_delegate_impl.h ('k') | ash/shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698