| 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/signin/profile_signin_confirmation_ui.h" | 5 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 11 #include "content/public/browser/web_ui.h" | 11 #include "content/public/browser/web_ui.h" |
| 12 #include "content/public/browser/web_ui_data_source.h" | 12 #include "content/public/browser/web_ui_data_source.h" |
| 13 #include "grit/browser_resources.h" | 13 #include "grit/browser_resources.h" |
| 14 #include "grit/chromium_strings.h" | 14 #include "grit/chromium_strings.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 18 | 18 |
| 19 ProfileSigninConfirmationUI::ProfileSigninConfirmationUI(content::WebUI* web_ui) | 19 ProfileSigninConfirmationUI::ProfileSigninConfirmationUI(content::WebUI* web_ui) |
| 20 : ConstrainedWebDialogUI(web_ui) { | 20 : ConstrainedWebDialogUI(web_ui) { |
| 21 content::WebUIDataSource* html_source = content::WebUIDataSource::Create( | 21 content::WebUIDataSource* html_source = content::WebUIDataSource::Create( |
| 22 chrome::kChromeUIProfileSigninConfirmationHost); | 22 chrome::kChromeUIProfileSigninConfirmationHost); |
| 23 html_source->SetUseJsonJSFormatV2(); | 23 html_source->SetUseJsonJSFormatV2(); |
| 24 | 24 |
| 25 html_source->AddLocalizedString( | 25 html_source->AddLocalizedString( |
| 26 "createProfileButtonText", | 26 "createProfileButtonText", |
| 27 IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_YES); | 27 IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE); |
| 28 html_source->AddLocalizedString( | 28 html_source->AddLocalizedString( |
| 29 "continueButtonText", | 29 "continueButtonText", |
| 30 IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_NO); | 30 IDS_ENTERPRISE_SIGNIN_CONTINUE); |
| 31 html_source->AddLocalizedString("okButtonText", IDS_OK); | 31 html_source->AddLocalizedString("okButtonText", IDS_OK); |
| 32 html_source->AddLocalizedString( | 32 html_source->AddLocalizedString( |
| 33 "cancelButtonText", | 33 "cancelButtonText", |
| 34 IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_CANCEL); | 34 IDS_ENTERPRISE_SIGNIN_CANCEL); |
| 35 html_source->AddLocalizedString( | 35 html_source->AddLocalizedString( |
| 36 "learnMoreText", | 36 "learnMoreText", |
| 37 IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE); | 37 IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_LEARN_MORE); |
| 38 html_source->AddLocalizedString( | 38 html_source->AddLocalizedString( |
| 39 "dialogTitle", | 39 "dialogTitle", |
| 40 IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_DIALOG_TITLE); | 40 IDS_ENTERPRISE_SIGNIN_TITLE); |
| 41 html_source->AddLocalizedString( | 41 html_source->AddLocalizedString( |
| 42 "dialogMessage", | 42 "dialogMessage", |
| 43 IDS_ENTERPRISE_SIGNIN_PROFILE_LINK_MESSAGE); | 43 IDS_ENTERPRISE_SIGNIN_EXPLANATION); |
| 44 html_source->AddLocalizedString( | 44 html_source->AddLocalizedString( |
| 45 "dialogPrompt", | 45 "dialogPrompt", |
| 46 IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_PROMPT); | 46 IDS_ENTERPRISE_SIGNIN_CREATE_NEW_PROFILE_MESSAGE); |
| 47 | 47 |
| 48 html_source->SetJsonPath("strings.js"); | 48 html_source->SetJsonPath("strings.js"); |
| 49 | 49 |
| 50 html_source->AddResourcePath("profile_signin_confirmation.js", | 50 html_source->AddResourcePath("profile_signin_confirmation.js", |
| 51 IDR_PROFILE_SIGNIN_CONFIRMATION_JS); | 51 IDR_PROFILE_SIGNIN_CONFIRMATION_JS); |
| 52 html_source->AddResourcePath("profile_signin_confirmation.css", | 52 html_source->AddResourcePath("profile_signin_confirmation.css", |
| 53 IDR_PROFILE_SIGNIN_CONFIRMATION_CSS); | 53 IDR_PROFILE_SIGNIN_CONFIRMATION_CSS); |
| 54 html_source->SetDefaultResource(IDR_PROFILE_SIGNIN_CONFIRMATION_HTML); | 54 html_source->SetDefaultResource(IDR_PROFILE_SIGNIN_CONFIRMATION_HTML); |
| 55 | 55 |
| 56 Profile* profile = Profile::FromWebUI(web_ui); | 56 Profile* profile = Profile::FromWebUI(web_ui); |
| 57 content::WebUIDataSource::Add(profile, html_source); | 57 content::WebUIDataSource::Add(profile, html_source); |
| 58 } | 58 } |
| 59 | 59 |
| 60 ProfileSigninConfirmationUI::~ProfileSigninConfirmationUI() { | 60 ProfileSigninConfirmationUI::~ProfileSigninConfirmationUI() { |
| 61 } | 61 } |
| OLD | NEW |