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(); |
} |