| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/webui/options/manage_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 void ManageProfileHandler::SwitchAppListProfile(const ListValue* args) { | 328 void ManageProfileHandler::SwitchAppListProfile(const ListValue* args) { |
| 329 DCHECK(args); | 329 DCHECK(args); |
| 330 DCHECK(ProfileManager::IsMultipleProfilesEnabled()); | 330 DCHECK(ProfileManager::IsMultipleProfilesEnabled()); |
| 331 | 331 |
| 332 const Value* file_path_value; | 332 const Value* file_path_value; |
| 333 base::FilePath profile_file_path; | 333 base::FilePath profile_file_path; |
| 334 if (!args->Get(0, &file_path_value) || | 334 if (!args->Get(0, &file_path_value) || |
| 335 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) | 335 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) |
| 336 return; | 336 return; |
| 337 | 337 |
| 338 AppListService::Get()->SetAppListProfile(profile_file_path); | 338 AppListService* app_list_service = AppListService::Get(); |
| 339 app_list_service->SetProfilePath(profile_file_path); |
| 340 app_list_service->ShowForSavedProfile(); |
| 341 |
| 339 // Close the settings app, since it will now be for the wrong profile. | 342 // Close the settings app, since it will now be for the wrong profile. |
| 340 web_ui()->GetWebContents()->Close(); | 343 web_ui()->GetWebContents()->Close(); |
| 341 } | 344 } |
| 342 #endif // defined(ENABLE_SETTINGS_APP) | 345 #endif // defined(ENABLE_SETTINGS_APP) |
| 343 | 346 |
| 344 void ManageProfileHandler::ProfileIconSelectionChanged( | 347 void ManageProfileHandler::ProfileIconSelectionChanged( |
| 345 const base::ListValue* args) { | 348 const base::ListValue* args) { |
| 346 DCHECK(args); | 349 DCHECK(args); |
| 347 | 350 |
| 348 base::FilePath profile_file_path; | 351 base::FilePath profile_file_path; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 g_browser_process->profile_manager()->profile_shortcut_manager(); | 456 g_browser_process->profile_manager()->profile_shortcut_manager(); |
| 454 DCHECK(shortcut_manager); | 457 DCHECK(shortcut_manager); |
| 455 | 458 |
| 456 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 459 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
| 457 | 460 |
| 458 // Update the UI buttons. | 461 // Update the UI buttons. |
| 459 OnHasProfileShortcuts(false); | 462 OnHasProfileShortcuts(false); |
| 460 } | 463 } |
| 461 | 464 |
| 462 } // namespace options | 465 } // namespace options |
| OLD | NEW |