| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 if (index != std::string::npos) { | 162 if (index != std::string::npos) { |
| 163 page += "#"; | 163 page += "#"; |
| 164 page += base::IntToString(index); | 164 page += base::IntToString(index); |
| 165 } | 165 } |
| 166 } else if (profile_open_action == | 166 } else if (profile_open_action == |
| 167 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { | 167 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { |
| 168 page += profiles::kUserManagerSelectProfileTaskManager; | 168 page += profiles::kUserManagerSelectProfileTaskManager; |
| 169 } else if (profile_open_action == | 169 } else if (profile_open_action == |
| 170 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { | 170 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { |
| 171 page += profiles::kUserManagerSelectProfileAboutChrome; | 171 page += profiles::kUserManagerSelectProfileAboutChrome; |
| 172 } else if (profile_open_action == |
| 173 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS) { |
| 174 page += profiles::kUserManagerSelectProfileChromeSettings; |
| 175 } else if (profile_open_action == |
| 176 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_MEMORY) { |
| 177 page += profiles::kUserManagerSelectProfileChromeMemory; |
| 172 } | 178 } |
| 173 callback.Run(guest_profile, page); | 179 callback.Run(guest_profile, page); |
| 174 } | 180 } |
| 175 | 181 |
| 176 // Updates Chrome services that require notification when | 182 // Updates Chrome services that require notification when |
| 177 // the new_profile_management's status changes. | 183 // the new_profile_management's status changes. |
| 178 void UpdateServicesWithNewProfileManagementFlag(Profile* profile, | 184 void UpdateServicesWithNewProfileManagementFlag(Profile* profile, |
| 179 bool new_flag_status) { | 185 bool new_flag_status) { |
| 180 AccountReconcilor* account_reconcilor = | 186 AccountReconcilor* account_reconcilor = |
| 181 AccountReconcilorFactory::GetForProfile(profile); | 187 AccountReconcilorFactory::GetForProfile(profile); |
| 182 account_reconcilor->OnNewProfileManagementFlagChanged(new_flag_status); | 188 account_reconcilor->OnNewProfileManagementFlagChanged(new_flag_status); |
| 183 } | 189 } |
| 184 | 190 |
| 185 } // namespace | 191 } // namespace |
| 186 | 192 |
| 187 namespace profiles { | 193 namespace profiles { |
| 188 | 194 |
| 189 // User Manager parameters are prefixed with hash. | 195 // User Manager parameters are prefixed with hash. |
| 190 const char kUserManagerDisplayTutorial[] = "#tutorial"; | 196 const char kUserManagerDisplayTutorial[] = "#tutorial"; |
| 191 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; | 197 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; |
| 192 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; | 198 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; |
| 199 const char kUserManagerSelectProfileChromeSettings[] = "#chrome-settings"; |
| 200 const char kUserManagerSelectProfileChromeMemory[] = "#chrome-memory"; |
| 193 | 201 |
| 194 void FindOrCreateNewWindowForProfile( | 202 void FindOrCreateNewWindowForProfile( |
| 195 Profile* profile, | 203 Profile* profile, |
| 196 chrome::startup::IsProcessStartup process_startup, | 204 chrome::startup::IsProcessStartup process_startup, |
| 197 chrome::startup::IsFirstRun is_first_run, | 205 chrome::startup::IsFirstRun is_first_run, |
| 198 chrome::HostDesktopType desktop_type, | 206 chrome::HostDesktopType desktop_type, |
| 199 bool always_create) { | 207 bool always_create) { |
| 200 #if defined(OS_IOS) | 208 #if defined(OS_IOS) |
| 201 NOTREACHED(); | 209 NOTREACHED(); |
| 202 #else | 210 #else |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 base::Bind(&OpenBrowserWindowForProfile, | 274 base::Bind(&OpenBrowserWindowForProfile, |
| 267 callback, | 275 callback, |
| 268 true, | 276 true, |
| 269 true, | 277 true, |
| 270 desktop_type), | 278 desktop_type), |
| 271 std::string()); | 279 std::string()); |
| 272 ProfileMetrics::LogProfileAddNewUser(metric); | 280 ProfileMetrics::LogProfileAddNewUser(metric); |
| 273 } | 281 } |
| 274 | 282 |
| 275 void GuestBrowserCloseSuccess(const base::FilePath& profile_path) { | 283 void GuestBrowserCloseSuccess(const base::FilePath& profile_path) { |
| 276 UserManager::Show(profile_path, | 284 UserManager::Show(base::FilePath(), |
| 277 profiles::USER_MANAGER_NO_TUTORIAL, | 285 profiles::USER_MANAGER_NO_TUTORIAL, |
| 278 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 286 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 279 } | 287 } |
| 280 | 288 |
| 281 void CloseGuestProfileWindows() { | 289 void CloseGuestProfileWindows() { |
| 282 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 290 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 283 Profile* profile = profile_manager->GetProfileByPath( | 291 Profile* profile = profile_manager->GetProfileByPath( |
| 284 ProfileManager::GetGuestProfilePath()); | 292 ProfileManager::GetGuestProfilePath()); |
| 285 | 293 |
| 286 if (profile) { | 294 if (profile) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: | 428 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: |
| 421 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 429 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 422 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; | 430 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; |
| 423 return; | 431 return; |
| 424 default: | 432 default: |
| 425 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 433 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 426 } | 434 } |
| 427 } | 435 } |
| 428 | 436 |
| 429 } // namespace profiles | 437 } // namespace profiles |
| OLD | NEW |