Chromium Code Reviews| 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/profiles/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 Profile* guest_profile, | 148 Profile* guest_profile, |
| 149 Profile::CreateStatus status) { | 149 Profile::CreateStatus status) { |
| 150 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) | 150 if (status != Profile::CREATE_STATUS_INITIALIZED || callback.is_null()) |
| 151 return; | 151 return; |
| 152 | 152 |
| 153 // Tell the webui which user should be focused. | 153 // Tell the webui which user should be focused. |
| 154 std::string page = chrome::kChromeUIUserManagerURL; | 154 std::string page = chrome::kChromeUIUserManagerURL; |
| 155 | 155 |
| 156 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { | 156 if (tutorial_mode == profiles::USER_MANAGER_TUTORIAL_OVERVIEW) { |
| 157 page += profiles::kUserManagerDisplayTutorial; | 157 page += profiles::kUserManagerDisplayTutorial; |
| 158 } else if (!profile_path_to_focus.empty()) { | 158 } else if (!profile_path_to_focus.empty() && |
| 159 profile_path_to_focus != ProfileManager::GetGuestProfilePath()) { | |
|
noms (inactive)
2014/10/07 21:25:48
Not sure why this would happen. Up until now, |pro
Mike Lerman
2014/10/08 15:41:37
It was! Until someone (rhymes with poms) changed c
| |
| 159 const ProfileInfoCache& cache = | 160 const ProfileInfoCache& cache = |
| 160 g_browser_process->profile_manager()->GetProfileInfoCache(); | 161 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 161 size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus); | 162 size_t index = cache.GetIndexOfProfileWithPath(profile_path_to_focus); |
| 162 if (index != std::string::npos) { | 163 if (index != std::string::npos) { |
| 163 page += "#"; | 164 page += "#"; |
| 164 page += base::IntToString(index); | 165 page += base::IntToString(index); |
| 165 } | 166 } |
| 166 } else if (profile_open_action == | 167 } else if (profile_open_action == |
| 167 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { | 168 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { |
| 168 page += profiles::kUserManagerSelectProfileTaskManager; | 169 page += profiles::kUserManagerSelectProfileTaskManager; |
| 169 } else if (profile_open_action == | 170 } else if (profile_open_action == |
| 170 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { | 171 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { |
| 171 page += profiles::kUserManagerSelectProfileAboutChrome; | 172 page += profiles::kUserManagerSelectProfileAboutChrome; |
| 173 } else if (profile_open_action == | |
| 174 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS) { | |
| 175 page += profiles::kUserManagerSelectProfileChromeSettings; | |
| 172 } | 176 } |
| 173 callback.Run(guest_profile, page); | 177 callback.Run(guest_profile, page); |
| 174 } | 178 } |
| 175 | 179 |
| 176 // Updates Chrome services that require notification when | 180 // Updates Chrome services that require notification when |
| 177 // the new_profile_management's status changes. | 181 // the new_profile_management's status changes. |
| 178 void UpdateServicesWithNewProfileManagementFlag(Profile* profile, | 182 void UpdateServicesWithNewProfileManagementFlag(Profile* profile, |
| 179 bool new_flag_status) { | 183 bool new_flag_status) { |
| 180 AccountReconcilor* account_reconcilor = | 184 AccountReconcilor* account_reconcilor = |
| 181 AccountReconcilorFactory::GetForProfile(profile); | 185 AccountReconcilorFactory::GetForProfile(profile); |
| 182 account_reconcilor->OnNewProfileManagementFlagChanged(new_flag_status); | 186 account_reconcilor->OnNewProfileManagementFlagChanged(new_flag_status); |
| 183 } | 187 } |
| 184 | 188 |
| 185 } // namespace | 189 } // namespace |
| 186 | 190 |
| 187 namespace profiles { | 191 namespace profiles { |
| 188 | 192 |
| 189 // User Manager parameters are prefixed with hash. | 193 // User Manager parameters are prefixed with hash. |
| 190 const char kUserManagerDisplayTutorial[] = "#tutorial"; | 194 const char kUserManagerDisplayTutorial[] = "#tutorial"; |
| 191 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; | 195 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; |
| 192 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; | 196 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; |
| 197 const char kUserManagerSelectProfileChromeSettings[] = "#chrome-settings"; | |
| 193 | 198 |
| 194 void FindOrCreateNewWindowForProfile( | 199 void FindOrCreateNewWindowForProfile( |
| 195 Profile* profile, | 200 Profile* profile, |
| 196 chrome::startup::IsProcessStartup process_startup, | 201 chrome::startup::IsProcessStartup process_startup, |
| 197 chrome::startup::IsFirstRun is_first_run, | 202 chrome::startup::IsFirstRun is_first_run, |
| 198 chrome::HostDesktopType desktop_type, | 203 chrome::HostDesktopType desktop_type, |
| 199 bool always_create) { | 204 bool always_create) { |
| 200 #if defined(OS_IOS) | 205 #if defined(OS_IOS) |
| 201 NOTREACHED(); | 206 NOTREACHED(); |
| 202 #else | 207 #else |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 420 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: | 425 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: |
| 421 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 426 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 422 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; | 427 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; |
| 423 return; | 428 return; |
| 424 default: | 429 default: |
| 425 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 430 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 426 } | 431 } |
| 427 } | 432 } |
| 428 | 433 |
| 429 } // namespace profiles | 434 } // namespace profiles |
| OLD | NEW |