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