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

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

Issue 219383006: Never create an app list for an incognito profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix cros Created 6 years, 9 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 | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_list_shower.cc
diff --git a/chrome/browser/ui/app_list/app_list_shower.cc b/chrome/browser/ui/app_list/app_list_shower.cc
index 973827a4508fdd8f9cc882907b3f0d5fe154d386..de466cb5e617756bb3c38e664d04d1fe7b66aaa4 100644
--- a/chrome/browser/ui/app_list/app_list_shower.cc
+++ b/chrome/browser/ui/app_list/app_list_shower.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_list_shower.h"
AppListShower::AppListShower(scoped_ptr<AppListFactory> factory,
@@ -27,16 +28,18 @@ void AppListShower::ShowAndReacquireFocus(Profile* requested_profile) {
void AppListShower::ShowForProfile(Profile* requested_profile) {
// If the app list is already displaying |profile| just activate it (in case
// we have lost focus).
- if (IsAppListVisible() && (requested_profile == profile_)) {
+ if (IsAppListVisible() && (requested_profile->IsSameProfile(profile_))) {
+ DCHECK(profile_);
benwells 2014/10/09 05:32:33 Are these DCHECKs related to this change or just g
tapted 2014/10/09 05:52:01 semi-related. They're not being added because I ti
app_list_->Show();
return;
}
if (!app_list_) {
CreateViewForProfile(requested_profile);
- } else if (requested_profile != profile_) {
- profile_ = requested_profile;
- app_list_->SetProfile(requested_profile);
+ } else if (!requested_profile->IsSameProfile(profile_)) {
+ DCHECK(profile_);
+ profile_ = requested_profile->GetOriginalProfile();
+ app_list_->SetProfile(profile_);
}
keep_alive_service_->EnsureKeepAlive();
@@ -52,7 +55,7 @@ gfx::NativeWindow AppListShower::GetWindow() {
}
void AppListShower::CreateViewForProfile(Profile* requested_profile) {
- profile_ = requested_profile;
+ profile_ = requested_profile->GetOriginalProfile();
app_list_.reset(factory_->CreateAppList(
profile_,
service_,
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698