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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 void ManageProfileHandler::SwitchAppListProfile(const base::ListValue* args) { | 416 void ManageProfileHandler::SwitchAppListProfile(const base::ListValue* args) { |
417 DCHECK(args); | 417 DCHECK(args); |
418 DCHECK(profiles::IsMultipleProfilesEnabled()); | 418 DCHECK(profiles::IsMultipleProfilesEnabled()); |
419 | 419 |
420 const base::Value* file_path_value; | 420 const base::Value* file_path_value; |
421 base::FilePath profile_file_path; | 421 base::FilePath profile_file_path; |
422 if (!args->Get(0, &file_path_value) || | 422 if (!args->Get(0, &file_path_value) || |
423 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) | 423 !base::GetValueAsFilePath(*file_path_value, &profile_file_path)) |
424 return; | 424 return; |
425 | 425 |
426 AppListService* app_list_service = AppListService::Get( | 426 AppListService* app_list_service = |
427 options::helper::GetDesktopType(web_ui())); | 427 AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE); |
428 app_list_service->SetProfilePath(profile_file_path); | 428 app_list_service->SetProfilePath(profile_file_path); |
429 app_list_service->Show(); | 429 app_list_service->Show(); |
430 | 430 |
431 // Close the settings app, since it will now be for the wrong profile. | 431 // Close the settings app, since it will now be for the wrong profile. |
432 web_ui()->GetWebContents()->Close(); | 432 web_ui()->GetWebContents()->Close(); |
433 } | 433 } |
434 #endif // defined(ENABLE_SETTINGS_APP) | 434 #endif // defined(ENABLE_SETTINGS_APP) |
435 | 435 |
436 void ManageProfileHandler::ProfileIconSelectionChanged( | 436 void ManageProfileHandler::ProfileIconSelectionChanged( |
437 const base::ListValue* args) { | 437 const base::ListValue* args) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 // Update the UI buttons. | 572 // Update the UI buttons. |
573 OnHasProfileShortcuts(false); | 573 OnHasProfileShortcuts(false); |
574 } | 574 } |
575 | 575 |
576 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { | 576 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { |
577 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); | 577 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); |
578 } | 578 } |
579 | 579 |
580 } // namespace options | 580 } // namespace options |
OLD | NEW |