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

Unified Diff: ash/test/test_shell_delegate.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/test/test_shell_delegate.h ('k') | ash/wm/app_list_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/test_shell_delegate.cc
diff --git a/ash/test/test_shell_delegate.cc b/ash/test/test_shell_delegate.cc
index fbfb2193878887f55f9173470347b3ee31e342c2..ca44f6ed895b184df9f1bad38f3acfec7ea14946 100644
--- a/ash/test/test_shell_delegate.cc
+++ b/ash/test/test_shell_delegate.cc
@@ -6,6 +6,9 @@
#include <limits>
+#include "ash/app_list/app_list_shower_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/gpu_support_stub.h"
#include "ash/media_delegate.h"
@@ -21,8 +24,8 @@
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "base/logging.h"
-#include "ui/app_list/app_list_model.h"
-#include "ui/app_list/app_list_view_delegate.h"
+#include "base/memory/ptr_util.h"
+#include "ui/app_list/shower/app_list_shower_impl.h"
#include "ui/app_list/test/app_list_test_view_delegate.h"
#include "ui/aura/window.h"
#include "ui/gfx/image/image.h"
@@ -76,12 +79,34 @@ class MediaDelegateImpl : public MediaDelegate {
DISALLOW_COPY_AND_ASSIGN(MediaDelegateImpl);
};
+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(
+ new app_list::test::AppListTestViewDelegate);
+ }
+ return app_list_view_delegate_.get();
+ }
+
+ private:
+ std::unique_ptr<app_list::AppListViewDelegate> app_list_view_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(AppListViewDelegateFactoryImpl);
+};
+
} // namespace
TestShellDelegate::TestShellDelegate()
: num_exit_requests_(0),
multi_profiles_enabled_(false),
- force_maximize_on_first_run_(false) {}
+ force_maximize_on_first_run_(false),
+ app_list_shower_delegate_factory_(new AppListShowerDelegateFactory(
+ base::WrapUnique(new AppListViewDelegateFactoryImpl))) {}
TestShellDelegate::~TestShellDelegate() {
}
@@ -142,10 +167,12 @@ void TestShellDelegate::RemoveVirtualKeyboardStateObserver(
void TestShellDelegate::OpenUrl(const GURL& url) {}
-app_list::AppListViewDelegate* TestShellDelegate::GetAppListViewDelegate() {
- if (!app_list_view_delegate_)
- app_list_view_delegate_.reset(new app_list::test::AppListTestViewDelegate);
- return app_list_view_delegate_.get();
+app_list::AppListShower* TestShellDelegate::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* TestShellDelegate::CreateShelfDelegate(ShelfModel* model) {
« no previous file with comments | « ash/test/test_shell_delegate.h ('k') | ash/wm/app_list_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698