OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/webui/welcome_ui_android.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 9 #include "chrome/common/url_constants.h" |
| 10 #include "grit/browser_resources.h" |
| 11 #include "grit/chromium_strings.h" |
| 12 #include "grit/generated_resources.h" |
| 13 #include "grit/google_chrome_strings.h" |
| 14 |
| 15 WelcomeUI::WelcomeUI(content::WebUI* web_ui) |
| 16 : content::WebUIController(web_ui) { |
| 17 // Set up the chrome://welcome source. |
| 18 ChromeWebUIDataSource* html_source = |
| 19 new ChromeWebUIDataSource(chrome::kChromeUIWelcomeHost); |
| 20 html_source->set_use_json_js_format_v2(); |
| 21 |
| 22 // Localized strings. |
| 23 html_source->AddLocalizedString("title", |
| 24 IDS_NEW_TAB_CHROME_WELCOME_PAGE_TITLE); |
| 25 html_source->AddLocalizedString("takeATour", IDS_FIRSTRUN_TAKE_TOUR); |
| 26 html_source->AddLocalizedString("firstRunSignedIn", IDS_FIRSTRUN_SIGNED_IN); |
| 27 html_source->AddLocalizedString("settings", IDS_FIRSTRUN_SETTINGS_LINK); |
| 28 |
| 29 // Add required resources. |
| 30 html_source->set_json_path("strings.js"); |
| 31 html_source->add_resource_path("about_welcome_android.css", |
| 32 IDR_ABOUT_WELCOME_CSS); |
| 33 html_source->add_resource_path("about_welcome_android.js", |
| 34 IDR_ABOUT_WELCOME_JS); |
| 35 html_source->set_default_resource(IDR_ABOUT_WELCOME_HTML); |
| 36 |
| 37 Profile* profile = Profile::FromWebUI(web_ui); |
| 38 ChromeURLDataManager::AddDataSource(profile, html_source); |
| 39 } |
| 40 |
| 41 WelcomeUI::~WelcomeUI() { |
| 42 } |
OLD | NEW |