OLD | NEW |
---|---|
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 Loading... | |
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(); | |
Daniel Erat
2013/12/19 20:25:54
what does GetOriginalProfile() return if we're in
tbarzic
2013/12/19 20:50:30
it returns the original profile; and it does seem
Daniel Erat
2013/12/19 21:13:52
until http://crbug.com/262299 is fixed, would it b
rpetterson
2013/12/19 21:28:15
To my knowledge, you cannot create an incognito pr
| |
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 Loading... | |
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 } |
OLD | NEW |