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

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

Issue 219383006: Never create an app list for an incognito profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/app_list/app_list_service_views.h" 5 #include "chrome/browser/ui/app_list/app_list_service_views.h"
6 6
7 #include "chrome/browser/apps/scoped_keep_alive.h" 7 #include "chrome/browser/apps/scoped_keep_alive.h"
8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" 8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
9 #include "ui/app_list/views/app_list_view.h" 9 #include "ui/app_list/views/app_list_view.h"
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 void AppListServiceViews::Init(Profile* initial_profile) { 25 void AppListServiceViews::Init(Profile* initial_profile) {
26 PerformStartupChecks(initial_profile); 26 PerformStartupChecks(initial_profile);
27 } 27 }
28 28
29 void AppListServiceViews::ShowForProfile(Profile* requested_profile) { 29 void AppListServiceViews::ShowForProfile(Profile* requested_profile) {
30 DCHECK(requested_profile); 30 DCHECK(requested_profile);
31 31
32 ScopedKeepAlive keep_alive; 32 ScopedKeepAlive keep_alive;
33 33
34 InvalidatePendingProfileLoads(); 34 CreateForProfile(requested_profile);
35 SetProfilePath(requested_profile->GetPath()); 35 shower_.ShowForCurrentProfile();
36 shower_.ShowForProfile(requested_profile);
37 RecordAppListLaunch(); 36 RecordAppListLaunch();
38 } 37 }
39 38
40 void AppListServiceViews::DismissAppList() { 39 void AppListServiceViews::DismissAppList() {
41 if (!can_dismiss_) 40 if (!can_dismiss_)
42 return; 41 return;
43 42
44 shower_.DismissAppList(); 43 shower_.DismissAppList();
45 } 44 }
46 45
47 bool AppListServiceViews::IsAppListVisible() const { 46 bool AppListServiceViews::IsAppListVisible() const {
48 return shower_.IsAppListVisible(); 47 return shower_.IsAppListVisible();
49 } 48 }
50 49
51 gfx::NativeWindow AppListServiceViews::GetAppListWindow() { 50 gfx::NativeWindow AppListServiceViews::GetAppListWindow() {
52 return shower_.GetWindow(); 51 return shower_.GetWindow();
53 } 52 }
54 53
55 Profile* AppListServiceViews::GetCurrentAppListProfile() { 54 Profile* AppListServiceViews::GetCurrentAppListProfile() {
56 return shower_.profile(); 55 return shower_.profile();
57 } 56 }
58 57
59 AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() { 58 AppListControllerDelegate* AppListServiceViews::GetControllerDelegate() {
60 return controller_delegate_.get(); 59 return controller_delegate_.get();
61 } 60 }
62 61
63 void AppListServiceViews::CreateForProfile(Profile* requested_profile) { 62 void AppListServiceViews::CreateForProfile(Profile* requested_profile) {
63 DCHECK(requested_profile);
64 InvalidatePendingProfileLoads();
64 shower_.CreateViewForProfile(requested_profile); 65 shower_.CreateViewForProfile(requested_profile);
66 SetProfilePath(shower_.profile()->GetPath());
65 } 67 }
66 68
67 void AppListServiceViews::DestroyAppList() { 69 void AppListServiceViews::DestroyAppList() {
68 if (!shower_.HasView()) 70 if (!shower_.HasView())
69 return; 71 return;
70 72
71 // Use CloseNow(). This can't be asynchronous because the profile will be 73 // Use CloseNow(). This can't be asynchronous because the profile will be
72 // deleted once this function returns. 74 // deleted once this function returns.
73 shower_.app_list()->GetWidget()->CloseNow(); 75 shower_.app_list()->GetWidget()->CloseNow();
74 DCHECK(!shower_.HasView()); 76 DCHECK(!shower_.HasView());
75 } 77 }
76 78
77 AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() { 79 AppListViewDelegate* AppListServiceViews::GetViewDelegateForCreate() {
78 return GetViewDelegate(shower_.profile()); 80 return GetViewDelegate(shower_.profile());
79 } 81 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | chrome/browser/ui/app_list/app_list_shower_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698