OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/personal_options_handler.h" | 5 #include "chrome/browser/dom_ui/personal_options_handler.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | |
9 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
10 #include "base/callback.h" | |
11 #include "base/path_service.h" | |
12 #include "base/stl_util-inl.h" | |
13 #include "base/utf_string_conversions.h" | |
14 #include "base/values.h" | 9 #include "base/values.h" |
15 #include "chrome/common/notification_service.h" | |
16 #include "chrome/common/chrome_paths.h" | |
17 #include "chrome/browser/browser_process.h" | |
18 #include "chrome/browser/profile.h" | |
19 #include "chrome/browser/profile_manager.h" | |
20 #include "chrome/browser/sync/profile_sync_service.h" | |
21 #include "grit/browser_resources.h" | |
22 #include "grit/chromium_strings.h" | 10 #include "grit/chromium_strings.h" |
23 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
24 #include "grit/locale_settings.h" | |
25 #include "grit/theme_resources.h" | |
26 | 12 |
27 PersonalOptionsHandler::PersonalOptionsHandler() { | 13 PersonalOptionsHandler::PersonalOptionsHandler() { |
28 } | 14 } |
29 | 15 |
30 PersonalOptionsHandler::~PersonalOptionsHandler() { | 16 PersonalOptionsHandler::~PersonalOptionsHandler() { |
31 } | 17 } |
32 | 18 |
33 void PersonalOptionsHandler::GetLocalizedValues( | 19 void PersonalOptionsHandler::GetLocalizedValues( |
34 DictionaryValue* localized_strings) { | 20 DictionaryValue* localized_strings) { |
35 FilePath user_data_dir; | |
36 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | |
37 ProfileManager* profile_manager = g_browser_process->profile_manager(); | |
38 Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); | |
39 ProfileSyncService* service = profile->GetProfileSyncService(); | |
40 | |
41 DCHECK(localized_strings); | 21 DCHECK(localized_strings); |
42 //Personal Stuff page | 22 localized_strings->SetString(L"passwordsGroupName", |
43 localized_strings->SetString(L"sync_section", | |
44 l10n_util::GetString(IDS_SYNC_OPTIONS_GROUP_NAME)); | |
45 localized_strings->SetString(L"sync_not_setup_info", | |
46 l10n_util::GetStringF(IDS_SYNC_NOT_SET_UP_INFO, | |
47 l10n_util::GetString(IDS_PRODUCT_NAME))); | |
48 localized_strings->SetString(L"start_sync", | |
49 l10n_util::GetString(IDS_SYNC_START_SYNC_BUTTON_LABEL)); | |
50 localized_strings->SetString(L"synced_to_user_with_time", | |
51 l10n_util::GetStringF(IDS_SYNC_ACCOUNT_SYNCED_TO_USER_WITH_TIME, | |
52 UTF16ToWide(service->GetAuthenticatedUsername()), | |
53 service->GetLastSyncedTimeString())); | |
54 localized_strings->SetString(L"sync_customize", | |
55 l10n_util::GetString(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL)); | |
56 localized_strings->SetString(L"stop_sync", | |
57 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL)); | |
58 | |
59 localized_strings->SetString(L"passwords", | |
60 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_GROUP_NAME)); | 23 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_GROUP_NAME)); |
61 localized_strings->SetString(L"passwords_asktosave", | 24 localized_strings->SetString(L"passwordsAskToSave", |
62 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_ASKTOSAVE)); | 25 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_ASKTOSAVE)); |
63 localized_strings->SetString(L"passwords_neversave", | 26 localized_strings->SetString(L"passwordsNeverSave", |
64 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_NEVERSAVE)); | 27 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_NEVERSAVE)); |
65 localized_strings->SetString(L"showpasswords", | 28 localized_strings->SetString(L"passwordShowPasswords", |
66 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS)); | 29 l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS)); |
67 | 30 localized_strings->SetString(L"autoFillSettingWindowsGroupName", |
68 localized_strings->SetString(L"autofill", | |
69 l10n_util::GetString(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME)); | 31 l10n_util::GetString(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME)); |
70 localized_strings->SetString(L"autofill_enable", | 32 localized_strings->SetString(L"autoFillEnable", |
71 l10n_util::GetString(IDS_OPTIONS_AUTOFILL_ENABLE)); | 33 l10n_util::GetString(IDS_OPTIONS_AUTOFILL_ENABLE)); |
72 localized_strings->SetString(L"autofill_disable", | 34 localized_strings->SetString(L"autoFillDisable", |
73 l10n_util::GetString(IDS_OPTIONS_AUTOFILL_DISABLE)); | 35 l10n_util::GetString(IDS_OPTIONS_AUTOFILL_DISABLE)); |
74 localized_strings->SetString(L"autofill_options", | 36 localized_strings->SetString(L"themesGroupName", |
75 l10n_util::GetString(IDS_AUTOFILL_OPTIONS)); | 37 l10n_util::GetString(IDS_THEMES_GROUP_NAME)); |
76 | 38 #if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) |
77 localized_strings->SetString(L"browsing_data", | 39 localized_strings->SetString(L"appearanceGroupName", |
| 40 l10n_util::GetString(IDS_APPEARANCE_GROUP_NAME)); |
| 41 localized_strings->SetString(L"themesGTKButton", |
| 42 l10n_util::GetString(IDS_THEMES_GTK_BUTTON)); |
| 43 localized_strings->SetString(L"themesSetClassic", |
| 44 l10n_util::GetString(IDS_THEMES_SET_CLASSIC)); |
| 45 localized_strings->SetString(L"showWindowDecorationsRadio", |
| 46 l10n_util::GetString(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); |
| 47 localized_strings->SetString(L"hideWindowDecorationsRadio", |
| 48 l10n_util::GetString(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); |
| 49 #endif |
| 50 localized_strings->SetString(L"themesResetButton", |
| 51 l10n_util::GetString(IDS_THEMES_RESET_BUTTON)); |
| 52 localized_strings->SetString(L"themesDefaultThemeLabel", |
| 53 l10n_util::GetString(IDS_THEMES_DEFAULT_THEME_LABEL)); |
| 54 localized_strings->SetString(L"themesGalleryButton", |
| 55 l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON)); |
| 56 localized_strings->SetString(L"browsingDataGroupName", |
78 l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME)); | 57 l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME)); |
79 localized_strings->SetString(L"import_data", | 58 localized_strings->SetString(L"importDataButton", |
80 l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_BUTTON)); | 59 l10n_util::GetString(IDS_OPTIONS_IMPORT_DATA_BUTTON)); |
81 | |
82 #if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) | |
83 localized_strings->SetString(L"appearance", | |
84 l10n_util::GetString(IDS_APPEARANCE_GROUP_NAME)); | |
85 localized_strings->SetString(L"themes_GTK_button", | |
86 l10n_util::GetString(IDS_THEMES_GTK_BUTTON)); | |
87 localized_strings->SetString(L"themes_set_classic", | |
88 l10n_util::GetString(IDS_THEMES_SET_CLASSIC)); | |
89 localized_strings->SetString(L"showWindow_decorations_radio", | |
90 l10n_util::GetString(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); | |
91 localized_strings->SetString(L"hideWindow_decorations_radio", | |
92 l10n_util::GetString(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); | |
93 localized_strings->SetString(L"themes_gallery", | |
94 l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON)); | |
95 #else | |
96 localized_strings->SetString(L"themes", | |
97 l10n_util::GetString(IDS_THEMES_GROUP_NAME)); | |
98 localized_strings->SetString(L"themes_reset", | |
99 l10n_util::GetString(IDS_THEMES_RESET_BUTTON)); | |
100 localized_strings->SetString(L"themes_gallery", | |
101 l10n_util::GetString(IDS_THEMES_GALLERY_BUTTON)); | |
102 localized_strings->SetString(L"themes_default", | |
103 l10n_util::GetString(IDS_THEMES_DEFAULT_THEME_LABEL)); | |
104 #endif | |
105 } | 60 } |
OLD | NEW |