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

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: . Created 7 years 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 #endif 322 #endif
323 323
324 ChromeLauncherController::ChromeLauncherController(Profile* profile, 324 ChromeLauncherController::ChromeLauncherController(Profile* profile,
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_) {
stevenjb 2013/12/26 22:34:17 Do we need to check for the right profile for Gues
tbarzic 2013/12/27 22:35:38 I don't think we do. If the profile is passed to t
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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 } 2018 }
2016 2019
2017 void ChromeLauncherController::ReleaseProfile() { 2020 void ChromeLauncherController::ReleaseProfile() {
2018 if (app_sync_ui_state_) 2021 if (app_sync_ui_state_)
2019 app_sync_ui_state_->RemoveObserver(this); 2022 app_sync_ui_state_->RemoveObserver(this);
2020 2023
2021 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); 2024 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this);
2022 2025
2023 pref_change_registrar_.RemoveAll(); 2026 pref_change_registrar_.RemoveAll();
2024 } 2027 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698