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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 115733007: Fix non-otr profile's file manager being launched in guest mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: profile->IsGuestSession instead of checking cmd line Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 ash::ShelfModel* model) 325 ash::ShelfModel* model)
326 : model_(model), 326 : model_(model),
327 item_delegate_manager_(NULL), 327 item_delegate_manager_(NULL),
328 profile_(profile), 328 profile_(profile),
329 app_sync_ui_state_(NULL), 329 app_sync_ui_state_(NULL),
330 ignore_persist_pinned_state_change_(false) { 330 ignore_persist_pinned_state_change_(false) {
331 if (!profile_) { 331 if (!profile_) {
332 // If no profile was passed, we take the currently active profile and use it 332 // If no profile was passed, we take the currently active profile and use it
333 // as the owner of the current desktop. 333 // as the owner of the current desktop.
334 // Use the original profile as on chromeos we may get a temporary off the 334 // Use the original profile as on chromeos we may get a temporary off the
335 // record profile. 335 // record profile, unless in guest session (where off the record profile is
336 profile_ = ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); 336 // the right one).
337 Profile* active_profile = ProfileManager::GetActiveUserProfile();
338 profile_ = active_profile->IsGuestSession() ? active_profile :
339 active_profile->GetOriginalProfile();
337 340
338 app_sync_ui_state_ = AppSyncUIState::Get(profile_); 341 app_sync_ui_state_ = AppSyncUIState::Get(profile_);
339 if (app_sync_ui_state_) 342 if (app_sync_ui_state_)
340 app_sync_ui_state_->AddObserver(this); 343 app_sync_ui_state_->AddObserver(this);
341 } 344 }
342 345
343 // All profile relevant settings get bound to the current profile. 346 // All profile relevant settings get bound to the current profile.
344 AttachProfile(profile_); 347 AttachProfile(profile_);
345 model_->AddObserver(this); 348 model_->AddObserver(this);
346 349
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 } 2025 }
2023 2026
2024 void ChromeLauncherController::ReleaseProfile() { 2027 void ChromeLauncherController::ReleaseProfile() {
2025 if (app_sync_ui_state_) 2028 if (app_sync_ui_state_)
2026 app_sync_ui_state_->RemoveObserver(this); 2029 app_sync_ui_state_->RemoveObserver(this);
2027 2030
2028 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); 2031 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this);
2029 2032
2030 pref_change_registrar_.RemoveAll(); 2033 pref_change_registrar_.RemoveAll();
2031 } 2034 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service_factory.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698