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/chromeos/extensions/first_run_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/first_run_private_api.h" |
6 | 6 |
| 7 #include "base/metrics/histogram.h" |
7 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/chromeos/first_run/first_run.h" | 9 #include "chrome/browser/chromeos/first_run/first_run.h" |
9 #include "chrome/browser/chromeos/login/user_manager.h" | 10 #include "chrome/browser/chromeos/login/user_manager.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
12 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
13 #include "ui/base/webui/web_ui_util.h" | 14 #include "ui/base/webui/web_ui_util.h" |
14 | 15 |
15 bool FirstRunPrivateGetLocalizedStringsFunction::RunImpl() { | 16 bool FirstRunPrivateGetLocalizedStringsFunction::RunImpl() { |
| 17 UMA_HISTOGRAM_COUNTS("CrosFirstRun.DialogShown", 1); |
16 base::DictionaryValue* localized_strings = new base::DictionaryValue(); | 18 base::DictionaryValue* localized_strings = new base::DictionaryValue(); |
17 chromeos::User* user = | 19 chromeos::User* user = |
18 chromeos::UserManager::Get()->GetUserByProfile(GetProfile()); | 20 chromeos::UserManager::Get()->GetUserByProfile(GetProfile()); |
19 if (!user->given_name().empty()) { | 21 if (!user->given_name().empty()) { |
20 localized_strings->SetString( | 22 localized_strings->SetString( |
21 "greetingHeader", | 23 "greetingHeader", |
22 l10n_util::GetStringFUTF16(IDS_FIRST_RUN_GREETING_STEP_HEADER, | 24 l10n_util::GetStringFUTF16(IDS_FIRST_RUN_GREETING_STEP_HEADER, |
23 user->given_name())); | 25 user->given_name())); |
24 } else { | 26 } else { |
25 localized_strings->SetString( | 27 localized_strings->SetString( |
(...skipping 14 matching lines...) Expand all Loading... |
40 l10n_util::GetStringUTF16(IDS_CLOSE)); | 42 l10n_util::GetStringUTF16(IDS_CLOSE)); |
41 webui::SetFontAndTextDirection(localized_strings); | 43 webui::SetFontAndTextDirection(localized_strings); |
42 SetResult(localized_strings); | 44 SetResult(localized_strings); |
43 return true; | 45 return true; |
44 } | 46 } |
45 | 47 |
46 bool FirstRunPrivateLaunchTutorialFunction::RunImpl() { | 48 bool FirstRunPrivateLaunchTutorialFunction::RunImpl() { |
47 chromeos::first_run::LaunchTutorial(); | 49 chromeos::first_run::LaunchTutorial(); |
48 return true; | 50 return true; |
49 } | 51 } |
OLD | NEW |