Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc

Issue 418043002: Add test for showing confirmation dialog for unsecure signin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix isolate dependency Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/enrollment_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/message_loop/message_loop.h" 13 #include "base/message_loop/message_loop.h"
14 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
15 #include "base/strings/stringprintf.h"
15 #include "base/values.h" 16 #include "base/values.h"
16 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/browsing_data/browsing_data_helper.h" 18 #include "chrome/browser/browsing_data/browsing_data_helper.h"
18 #include "chrome/browser/browsing_data/browsing_data_remover.h" 19 #include "chrome/browser/browsing_data/browsing_data_remover.h"
19 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 20 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
20 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h" 21 #include "chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.h"
22 #include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h"
21 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" 24 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h"
23 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 25 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
24 #include "chrome/grit/generated_resources.h" 26 #include "chrome/grit/generated_resources.h"
25 #include "chromeos/network/network_state.h" 27 #include "chromeos/network/network_state.h"
26 #include "chromeos/network/network_state_handler.h" 28 #include "chromeos/network/network_state_handler.h"
27 #include "components/policy/core/browser/cloud/message_util.h" 29 #include "components/policy/core/browser/cloud/message_util.h"
28 #include "content/public/browser/web_contents.h" 30 #include "content/public/browser/web_contents.h"
29 #include "google_apis/gaia/gaia_auth_fetcher.h" 31 #include "google_apis/gaia/gaia_auth_fetcher.h"
30 #include "google_apis/gaia/gaia_auth_util.h" 32 #include "google_apis/gaia/gaia_auth_util.h"
31 #include "google_apis/gaia/gaia_constants.h" 33 #include "google_apis/gaia/gaia_constants.h"
32 #include "google_apis/gaia/gaia_urls.h" 34 #include "google_apis/gaia/gaia_urls.h"
33 #include "google_apis/gaia/google_service_auth_error.h" 35 #include "google_apis/gaia/google_service_auth_error.h"
34 #include "net/url_request/url_request_context_getter.h" 36 #include "net/url_request/url_request_context_getter.h"
35 #include "ui/base/l10n/l10n_util.h" 37 #include "ui/base/l10n/l10n_util.h"
36 38
37 namespace chromeos { 39 namespace chromeos {
38 namespace { 40 namespace {
39 41
40 const char kJsScreenPath[] = "login.OAuthEnrollmentScreen"; 42 const char kJsScreenPath[] = "login.OAuthEnrollmentScreen";
41 43
42 // Start page of GAIA authentication extension.
43 const char kGaiaExtStartPage[] =
44 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/main.html";
45
46 // Enrollment step names. 44 // Enrollment step names.
47 const char kEnrollmentStepSignin[] = "signin"; 45 const char kEnrollmentStepSignin[] = "signin";
48 const char kEnrollmentStepSuccess[] = "success"; 46 const char kEnrollmentStepSuccess[] = "success";
49 47
50 // Enrollment mode strings. 48 // Enrollment mode strings.
51 const char* const kModeStrings[EnrollmentScreenActor::ENROLLMENT_MODE_COUNT] = 49 const char* const kModeStrings[EnrollmentScreenActor::ENROLLMENT_MODE_COUNT] =
52 { "manual", "forced", "auto", "recovery" }; 50 { "manual", "forced", "auto", "recovery" };
53 51
54 std::string EnrollmentModeToString(EnrollmentScreenActor::EnrollmentMode mode) { 52 std::string EnrollmentModeToString(EnrollmentScreenActor::EnrollmentMode mode) {
55 CHECK(0 <= mode && mode < EnrollmentScreenActor::ENROLLMENT_MODE_COUNT); 53 CHECK(0 <= mode && mode < EnrollmentScreenActor::ENROLLMENT_MODE_COUNT);
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 return; 581 return;
584 582
585 if (error.state() != GoogleServiceAuthError::NONE) 583 if (error.state() != GoogleServiceAuthError::NONE)
586 controller_->OnAuthError(error); 584 controller_->OnAuthError(error);
587 else 585 else
588 controller_->OnOAuthTokenAvailable(token); 586 controller_->OnOAuthTokenAvailable(token);
589 } 587 }
590 588
591 void EnrollmentScreenHandler::DoShow() { 589 void EnrollmentScreenHandler::DoShow() {
592 base::DictionaryValue screen_data; 590 base::DictionaryValue screen_data;
593 screen_data.SetString("signin_url", kGaiaExtStartPage); 591 screen_data.SetString(
592 "signin_url",
593 base::StringPrintf("%s/main.html", extensions::kGaiaAuthExtensionOrigin));
594 screen_data.SetString("gaiaUrl", GaiaUrls::GetInstance()->gaia_url().spec()); 594 screen_data.SetString("gaiaUrl", GaiaUrls::GetInstance()->gaia_url().spec());
595 screen_data.SetString("enrollment_mode", 595 screen_data.SetString("enrollment_mode",
596 EnrollmentModeToString(enrollment_mode_)); 596 EnrollmentModeToString(enrollment_mode_));
597 screen_data.SetString("management_domain", management_domain_); 597 screen_data.SetString("management_domain", management_domain_);
598 598
599 ShowScreen(OobeUI::kScreenOobeEnrollment, &screen_data); 599 ShowScreen(OobeUI::kScreenOobeEnrollment, &screen_data);
600 } 600 }
601 601
602 } // namespace chromeos 602 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698