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/chromeos/first_run/first_run_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/chromeos/login/user_manager.h" | 9 #include "chrome/browser/chromeos/login/user_manager.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_handler.h" | 11 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_handler.h" |
12 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
13 #include "chromeos/chromeos_switches.h" | 13 #include "chromeos/chromeos_switches.h" |
14 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
15 #include "content/public/browser/web_ui_data_source.h" | 15 #include "content/public/browser/web_ui_data_source.h" |
16 #include "grit/browser_resources.h" | 16 #include "grit/browser_resources.h" |
| 17 #include "grit/chromium_strings.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
19 #include "ui/base/webui/web_ui_util.h" | 20 #include "ui/base/webui/web_ui_util.h" |
20 | 21 |
21 namespace { | 22 namespace { |
22 | 23 |
23 const char kFirstRunJSPath[] = "first_run.js"; | 24 const char kFirstRunJSPath[] = "first_run.js"; |
24 const char kShelfAlignmentBottom[] = "bottom"; | 25 const char kShelfAlignmentBottom[] = "bottom"; |
25 const char kShelfAlignmentLeft[] = "left"; | 26 const char kShelfAlignmentLeft[] = "left"; |
26 const char kShelfAlignmentRight[] = "right"; | 27 const char kShelfAlignmentRight[] = "right"; |
27 | 28 |
28 void SetLocalizedStrings(base::DictionaryValue* localized_strings) { | 29 void SetLocalizedStrings(base::DictionaryValue* localized_strings) { |
29 localized_strings->SetString( | 30 localized_strings->SetString( |
30 "appListHeader", | 31 "appListHeader", |
31 l10n_util::GetStringUTF16(IDS_FIRST_RUN_APP_LIST_STEP_HEADER)); | 32 l10n_util::GetStringUTF16(IDS_FIRST_RUN_APP_LIST_STEP_HEADER)); |
32 localized_strings->SetString( | 33 localized_strings->SetString( |
33 "appListText1", | 34 "appListText1", |
34 l10n_util::GetStringUTF16(IDS_FIRST_RUN_APP_LIST_STEP_TEXT_1)); | 35 l10n_util::GetStringUTF16(IDS_FIRST_RUN_APP_LIST_STEP_TEXT_1)); |
35 localized_strings->SetString( | 36 localized_strings->SetString( |
36 "appListText2", | 37 "appListText2", |
37 l10n_util::GetStringUTF16(IDS_FIRST_RUN_APP_LIST_STEP_TEXT_2)); | 38 l10n_util::GetStringUTF16(IDS_FIRST_RUN_APP_LIST_STEP_TEXT_2)); |
38 localized_strings->SetString( | 39 localized_strings->SetString( |
39 "trayHeader", l10n_util::GetStringUTF16(IDS_FIRST_RUN_TRAY_STEP_HEADER)); | 40 "trayHeader", l10n_util::GetStringUTF16(IDS_FIRST_RUN_TRAY_STEP_HEADER)); |
40 localized_strings->SetString( | 41 localized_strings->SetString( |
41 "trayText", l10n_util::GetStringUTF16(IDS_FIRST_RUN_TRAY_STEP_TEXT)); | 42 "trayText", l10n_util::GetStringUTF16(IDS_FIRST_RUN_TRAY_STEP_TEXT)); |
42 localized_strings->SetString( | 43 localized_strings->SetString( |
43 "helpHeader", l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_HEADER)); | 44 "helpHeader", l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_HEADER)); |
| 45 base::string16 product_name = |
| 46 l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME); |
44 localized_strings->SetString( | 47 localized_strings->SetString( |
45 "helpText1", l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_TEXT_1)); | 48 "helpText1", l10n_util::GetStringFUTF16(IDS_FIRST_RUN_HELP_STEP_TEXT_1, |
| 49 product_name)); |
46 localized_strings->SetString( | 50 localized_strings->SetString( |
47 "helpText2", l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_TEXT_2)); | 51 "helpText2", l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_TEXT_2)); |
48 localized_strings->SetString( | 52 localized_strings->SetString( |
49 "helpKeepExploringButton", | 53 "helpKeepExploringButton", |
50 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_KEEP_EXPLORING_BUTTON)); | 54 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_KEEP_EXPLORING_BUTTON)); |
51 localized_strings->SetString( | 55 localized_strings->SetString( |
52 "helpFinishButton", | 56 "helpFinishButton", |
53 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_FINISH_BUTTON)); | 57 l10n_util::GetStringUTF16(IDS_FIRST_RUN_HELP_STEP_FINISH_BUTTON)); |
54 localized_strings->SetString( | 58 localized_strings->SetString( |
55 "nextButton", l10n_util::GetStringUTF16(IDS_FIRST_RUN_NEXT_BUTTON)); | 59 "nextButton", l10n_util::GetStringUTF16(IDS_FIRST_RUN_NEXT_BUTTON)); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 : WebUIController(web_ui), | 101 : WebUIController(web_ui), |
98 actor_(NULL) { | 102 actor_(NULL) { |
99 FirstRunHandler* handler = new FirstRunHandler(); | 103 FirstRunHandler* handler = new FirstRunHandler(); |
100 actor_ = handler; | 104 actor_ = handler; |
101 web_ui->AddMessageHandler(handler); | 105 web_ui->AddMessageHandler(handler); |
102 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), CreateDataSource()); | 106 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), CreateDataSource()); |
103 } | 107 } |
104 | 108 |
105 } // namespace chromeos | 109 } // namespace chromeos |
106 | 110 |
OLD | NEW |