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/ui/webui/signin/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 } | 495 } |
496 } | 496 } |
497 | 497 |
498 void UserManagerScreenHandler::HandleAreAllProfilesLocked( | 498 void UserManagerScreenHandler::HandleAreAllProfilesLocked( |
499 const base::ListValue* args) { | 499 const base::ListValue* args) { |
500 std::string webui_callback_id; | 500 std::string webui_callback_id; |
501 CHECK_EQ(1U, args->GetSize()); | 501 CHECK_EQ(1U, args->GetSize()); |
502 bool success = args->GetString(0, &webui_callback_id); | 502 bool success = args->GetString(0, &webui_callback_id); |
503 DCHECK(success); | 503 DCHECK(success); |
504 | 504 |
505 web_ui()->CallJavascriptFunctionUnsafe( | 505 AllowJavascript(); |
506 "cr.webUIResponse", base::StringValue(webui_callback_id), | 506 ResolveJavascriptCallback( |
507 base::FundamentalValue(true), | 507 base::StringValue(webui_callback_id), |
508 base::FundamentalValue(profiles::AreAllProfilesLocked())); | 508 base::FundamentalValue(profiles::AreAllProfilesLocked())); |
509 } | 509 } |
510 | 510 |
511 void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) { | 511 void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) { |
512 const base::Value* profile_path_value = NULL; | 512 const base::Value* profile_path_value = NULL; |
513 if (!args->Get(0, &profile_path_value)) | 513 if (!args->Get(0, &profile_path_value)) |
514 return; | 514 return; |
515 | 515 |
516 base::FilePath profile_path; | 516 base::FilePath profile_path; |
517 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) | 517 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 Profile* profile, Profile::CreateStatus profile_create_status) { | 1012 Profile* profile, Profile::CreateStatus profile_create_status) { |
1013 Browser* browser = chrome::FindAnyBrowser(profile, false); | 1013 Browser* browser = chrome::FindAnyBrowser(profile, false); |
1014 if (browser && browser->window()) { | 1014 if (browser && browser->window()) { |
1015 OnBrowserWindowReady(browser); | 1015 OnBrowserWindowReady(browser); |
1016 } else { | 1016 } else { |
1017 registrar_.Add(this, | 1017 registrar_.Add(this, |
1018 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 1018 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
1019 content::NotificationService::AllSources()); | 1019 content::NotificationService::AllSources()); |
1020 } | 1020 } |
1021 } | 1021 } |
OLD | NEW |