Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / extensions / first_run_private_api.cc
blobb533ec105438d43b1784dfa8564c0e792bd5d8fb
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(
23 "greetingHeader",
24 l10n_util::GetStringFUTF16(IDS_FIRST_RUN_GREETING_STEP_HEADER,
25 user->given_name()));
26 } else {
27 localized_strings->SetString(
28 "greetingHeader",
29 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_HEADER_GENERAL));
31 localized_strings->SetString(
32 "greetingText1",
33 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_TEXT_1));
34 localized_strings->SetString(
35 "greetingText2",
36 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_TEXT_2));
37 localized_strings->SetString(
38 "greetingButton",
39 l10n_util::GetStringUTF16(IDS_FIRST_RUN_GREETING_STEP_BUTTON));
40 localized_strings->SetString(
41 "closeButton",
42 l10n_util::GetStringUTF16(IDS_CLOSE));
43 webui::SetFontAndTextDirection(localized_strings);
44 SetResult(localized_strings);
45 return true;
48 bool FirstRunPrivateLaunchTutorialFunction::RunImpl() {
49 chromeos::first_run::LaunchTutorial();
50 return true;