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

Unified Diff: chrome/browser/ui/app_list/app_list_service_views.cc

Issue 231883003: [stash] 20140404-crbug-312961-mac-views-bridge-C-wholegrid Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: chrome/browser/ui/app_list/app_list_service_views.cc
diff --git a/chrome/browser/ui/app_list/app_list_service_views.cc b/chrome/browser/ui/app_list/app_list_service_views.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cdeecffab39887894e7fddd9d7f60f37ffd1eec1
--- /dev/null
+++ b/chrome/browser/ui/app_list/app_list_service_views.cc
@@ -0,0 +1,81 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/app_list/app_list_service_views.h"
+
+#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
+#include "chrome/browser/ui/app_list/app_list_creator.h"
+
+AppListServiceViews::AppListServiceViews(
+ scoped_ptr<AppListControllerDelegate> controller_delegate)
+ : creator_(new AppListCreator(this)),
+ controller_delegate_(controller_delegate.Pass())
+}
+
+AppListServiceViews::~AppListServiceViews() {}
+
+void AppListServiceViews::OnAppListClosing() {
+ can_close_ = true;
+ creator_->AppListWillBeDestroyed();
+}
+
+void AppListServiceViews::Init(Profile* initial_profile) {
+ PerformStartupChecks(initial_profile);
+}
+
+void AppListServiceViews::CreateForProfile(Profile* requested_profile) {
+ creator_->CreateViewForProfile(requested_profile);
+}
+
+void AppListServiceViews::ShowForProfile(Profile* requested_profile) {
+ DCHECK(requested_profile);
+ if (requested_profile->IsManaged())
+ return;
+
+ AutoKeepAlive show_app_list_keepalive;
+
+ InvalidatePendingProfileLoads();
+ SetProfilePath(requested_profile->GetPath());
+ creator_->ShowForProfile(requested_profile);
+ RecordAppListLaunch();
+}
+
+void AppListServiceViews::DismissAppList() {
+ creator_->DismissAppList();
+}
+
+bool AppListServiceViews::IsAppListVisible() const {
+ return creator_->IsAppListVisible();
+}
+
+gfx::NativeWindow AppListServiceViews::GetAppListWindow() {
+ return creator_->GetWindow();
+}
+
+Profile* AppListServiceViews::GetCurrentAppListProfile() {
+ return creator_->profile();
+}
+
+AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() {
+ return controller_delegate_.get();
+}
+
+AppListControllerDelegate*
+AppListServiceViews::GetControllerDelegateForCreate() {
+ return controller_delegate_.get();
+}
+
+bool AppListServiceViews::CanCloseAppList() {
+ return can_close_;
+}
+
+void AppListServiceViews::EnsureKeepAlive() {
+ if (!keep_alive_)
+ keep_alive_.reset(new AutoKeepAlive());
+}
+
+void AppListServiceViews::FreeKeepAlive() {
+ if (keep_alive_)
+ keep_alive_.reset();
+}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_controller_browsertest.cc ('k') | chrome/browser/ui/gtk/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698