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

Side by Side Diff: chrome/browser/ui/app_list/app_list_service_views.cc

Issue 225053004: Refactor views app list services to allow more code sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows is the worst 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/app_list/app_list_service_views.h"
6
7 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
8 #include "chrome/browser/ui/app_list/scoped_keep_alive.h"
9
10 AppListServiceViews::AppListServiceViews(
11 scoped_ptr<AppListControllerDelegate> controller_delegate)
12 : shower_(this),
13 can_dismiss_(true),
14 controller_delegate_(controller_delegate.Pass()) {
15 }
16
17 AppListServiceViews::~AppListServiceViews() {}
18
19 void AppListServiceViews::OnViewBeingDestroyed() {
20 can_dismiss_ = true;
21 shower_.HandleViewBeingDestroyed();
22 }
23
24 void AppListServiceViews::Init(Profile* initial_profile) {
25 PerformStartupChecks(initial_profile);
26 }
27
28 void AppListServiceViews::CreateForProfile(Profile* requested_profile) {
29 shower_.CreateViewForProfile(requested_profile);
30 }
31
32 void AppListServiceViews::ShowForProfile(Profile* requested_profile) {
33 DCHECK(requested_profile);
34 if (requested_profile->IsManaged())
35 return;
36
37 ScopedKeepAlive keep_alive;
38
39 InvalidatePendingProfileLoads();
40 SetProfilePath(requested_profile->GetPath());
41 shower_.ShowForProfile(requested_profile);
42 RecordAppListLaunch();
43 }
tapted 2014/04/23 03:06:53 apart from "shower_->" becoming "shower_.", this i
44
45 void AppListServiceViews::DismissAppList() {
46 if (!can_dismiss_)
47 return;
48
49 shower_.DismissAppList();
50 }
51
52 bool AppListServiceViews::IsAppListVisible() const {
53 return shower_.IsAppListVisible();
54 }
55
56 gfx::NativeWindow AppListServiceViews::GetAppListWindow() {
57 return shower_.GetWindow();
58 }
59
60 Profile* AppListServiceViews::GetCurrentAppListProfile() {
61 return shower_.profile();
62 }
63
64 AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() {
65 return controller_delegate_.get();
66 }
67
68 AppListControllerDelegate*
69 AppListServiceViews::GetControllerDelegateForCreate() {
70 return controller_delegate_.get();
71 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698