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

Unified Diff: chrome/browser/ui/app_list/app_list_shower_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/app_list_shower_views.cc
diff --git a/chrome/browser/ui/app_list/app_list_shower_views.cc b/chrome/browser/ui/app_list/app_list_shower_views.cc
index b895fe1b2d8bedc1fc76e1cef1cad631ea4a322b..809ee6c2573e5deffc181a3094baef159d6db481 100644
--- a/chrome/browser/ui/app_list/app_list_shower_views.cc
+++ b/chrome/browser/ui/app_list/app_list_shower_views.cc
@@ -24,24 +24,15 @@ AppListShower::AppListShower(AppListShowerDelegate* delegate)
AppListShower::~AppListShower() {
}
-void AppListShower::ShowForProfile(Profile* requested_profile) {
+void AppListShower::ShowForCurrentProfile() {
+ DCHECK(HasView());
+ keep_alive_.reset(new ScopedKeepAlive);
+
// If the app list is already displaying |profile| just activate it (in case
// we have lost focus).
- if (IsAppListVisible() && (requested_profile == profile_)) {
- Show();
- return;
- }
-
- if (!HasView()) {
- CreateViewForProfile(requested_profile);
- } else if (requested_profile != profile_) {
- profile_ = requested_profile;
- UpdateViewForNewProfile();
- }
-
- keep_alive_.reset(new ScopedKeepAlive);
if (!IsAppListVisible())
delegate_->MoveNearCursor(app_list_);
+
Show();
}
@@ -52,7 +43,15 @@ gfx::NativeWindow AppListShower::GetWindow() {
}
void AppListShower::CreateViewForProfile(Profile* requested_profile) {
- profile_ = requested_profile;
+ DCHECK(requested_profile);
+ if (HasView() && requested_profile->IsSameProfile(profile_))
+ return;
+
+ profile_ = requested_profile->GetOriginalProfile();
+ if (HasView()) {
+ UpdateViewForNewProfile();
+ return;
+ }
app_list_ = MakeViewForCurrentProfile();
delegate_->OnViewCreated();
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_shower_views.h ('k') | chrome/browser/ui/app_list/app_list_shower_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698