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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/extensions/first_run_private_api.h"
7 #include "base/metrics/histogram.h"
8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/first_run/first_run.h"
10 #include "chrome/browser/chromeos/login/user_manager.h"
11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "grit/generated_resources.h"
13 #include "ui/base/l10n/l10n_util.h"
14 #include "ui/base/webui/web_ui_util.h"
16 bool FirstRunPrivateGetLocalizedStringsFunction::RunImpl() {
17 UMA_HISTOGRAM_COUNTS("CrosFirstRun.DialogShown", 1);
18 base::DictionaryValue
* localized_strings
= new base::DictionaryValue();
19 chromeos::User
* user
=
20 chromeos::UserManager::Get()->GetUserByProfile(GetProfile());
21 if (!user
->given_name().empty()) {
22 localized_strings
->SetString(
24 l10n_util::GetStringFUTF16(IDS_FIRST_RUN_GREETING_STEP_HEADER
,
27 localized_strings
->SetString(
29 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_HEADER_GENERAL
));
31 localized_strings
->SetString(
33 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_TEXT_1
));
34 localized_strings
->SetString(
36 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_TEXT_2
));
37 localized_strings
->SetString(
39 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_BUTTON
));
40 localized_strings
->SetString(
42 l10n_util::GetStringUTF16(IDS_CLOSE
));
43 webui::SetFontAndTextDirection(localized_strings
);
44 SetResult(localized_strings
);
48 bool FirstRunPrivateLaunchTutorialFunction::RunImpl() {
49 chromeos::first_run::LaunchTutorial();