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()->CallJavascriptFunction( | 505 AllowJavascript(); |
506 "cr.webUIResponse", | 506 ResolveJavascriptCallback( |
507 base::StringValue(webui_callback_id), | 507 base::StringValue(webui_callback_id), |
508 base::FundamentalValue(true), | |
509 base::FundamentalValue(profiles::AreAllProfilesLocked())); | 508 base::FundamentalValue(profiles::AreAllProfilesLocked())); |
510 } | 509 } |
511 | 510 |
512 void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) { | 511 void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) { |
513 const base::Value* profile_path_value = NULL; | 512 const base::Value* profile_path_value = NULL; |
514 if (!args->Get(0, &profile_path_value)) | 513 if (!args->Get(0, &profile_path_value)) |
515 return; | 514 return; |
516 | 515 |
517 base::FilePath profile_path; | 516 base::FilePath profile_path; |
518 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) | 517 if (!base::GetValueAsFilePath(*profile_path_value, &profile_path)) |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 Profile* profile, Profile::CreateStatus profile_create_status) { | 1014 Profile* profile, Profile::CreateStatus profile_create_status) { |
1016 Browser* browser = chrome::FindAnyBrowser(profile, false); | 1015 Browser* browser = chrome::FindAnyBrowser(profile, false); |
1017 if (browser && browser->window()) { | 1016 if (browser && browser->window()) { |
1018 OnBrowserWindowReady(browser); | 1017 OnBrowserWindowReady(browser); |
1019 } else { | 1018 } else { |
1020 registrar_.Add(this, | 1019 registrar_.Add(this, |
1021 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 1020 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
1022 content::NotificationService::AllSources()); | 1021 content::NotificationService::AllSources()); |
1023 } | 1022 } |
1024 } | 1023 } |
OLD | NEW |