| OLD | NEW |
| 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/welcome_ui_android.h" | 5 #include "chrome/browser/ui/webui/welcome_ui_android.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 if (tos_visible) { | 58 if (tos_visible) { |
| 59 std::string privacy_notice_url = | 59 std::string privacy_notice_url = |
| 60 base::StringPrintf(kPrivacyNoticeBaseURL, locale.c_str()); | 60 base::StringPrintf(kPrivacyNoticeBaseURL, locale.c_str()); |
| 61 tos_html = l10n_util::GetStringFUTF16( | 61 tos_html = l10n_util::GetStringFUTF16( |
| 62 IDS_FIRSTRUN_TOS_EXPLANATION, base::UTF8ToUTF16(privacy_notice_url)); | 62 IDS_FIRSTRUN_TOS_EXPLANATION, base::UTF8ToUTF16(privacy_notice_url)); |
| 63 } | 63 } |
| 64 html_source->AddString("tosHtml", tos_html); | 64 html_source->AddString("tosHtml", tos_html); |
| 65 | 65 |
| 66 // Add required resources. | 66 // Add required resources. |
| 67 html_source->SetJsonPath("strings.js"); | 67 html_source->SetJsonPath("strings.js"); |
| 68 html_source->AddResourcePath("about_welcome_android.css", | |
| 69 IDR_ABOUT_WELCOME_CSS); | |
| 70 html_source->AddResourcePath("about_welcome_android.js", | |
| 71 IDR_ABOUT_WELCOME_JS); | |
| 72 html_source->SetDefaultResource(IDR_ABOUT_WELCOME_HTML); | 68 html_source->SetDefaultResource(IDR_ABOUT_WELCOME_HTML); |
| 73 | 69 |
| 74 Profile* profile = Profile::FromWebUI(web_ui); | 70 Profile* profile = Profile::FromWebUI(web_ui); |
| 75 content::WebUIDataSource::Add(profile, html_source); | 71 content::WebUIDataSource::Add(profile, html_source); |
| 76 | 72 |
| 77 // Add message handlers. | 73 // Add message handlers. |
| 78 web_ui->AddMessageHandler(new WelcomeHandler()); | 74 web_ui->AddMessageHandler(new WelcomeHandler()); |
| 79 } | 75 } |
| 80 | 76 |
| 81 WelcomeUI::~WelcomeUI() { | 77 WelcomeUI::~WelcomeUI() { |
| 82 } | 78 } |
| OLD | NEW |