OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options2/browser_options_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/browser_options_handler2.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 default_browser_worker_->ObserverDestroyed(); | 104 default_browser_worker_->ObserverDestroyed(); |
105 if (template_url_service_) | 105 if (template_url_service_) |
106 template_url_service_->RemoveObserver(this); | 106 template_url_service_->RemoveObserver(this); |
107 } | 107 } |
108 | 108 |
109 void BrowserOptionsHandler::GetLocalizedValues( | 109 void BrowserOptionsHandler::GetLocalizedValues( |
110 DictionaryValue* localized_strings) { | 110 DictionaryValue* localized_strings) { |
111 DCHECK(localized_strings); | 111 DCHECK(localized_strings); |
112 | 112 |
113 static OptionsStringResource resources[] = { | 113 static OptionsStringResource resources[] = { |
114 { "advancedOptionsButtonTitle", IDS_OPTIONS_ADVANCED_BUTTON_TITLE }, | 114 { "advancedSettings", IDS_OPTIONS_ADVANCED_BUTTON_TITLE }, |
115 { "autologinEnabled", IDS_OPTIONS_PASSWORDS_AUTOLOGIN }, | 115 { "autologinEnabled", IDS_OPTIONS_PASSWORDS_AUTOLOGIN }, |
116 { "browsingData", IDS_OPTIONS_BROWSING_DATA_GROUP_NAME }, // needed? | 116 { "browsingData", IDS_OPTIONS_BROWSING_DATA_GROUP_NAME }, // needed? |
117 { "changeHomePage", IDS_OPTIONS_CHANGE_HOME_PAGE }, | 117 { "changeHomePage", IDS_OPTIONS_CHANGE_HOME_PAGE }, |
118 { "customizeSync", IDS_OPTIONS2_CUSTOMIZE_SYNC_BUTTON_LABEL }, | 118 { "customizeSync", IDS_OPTIONS2_CUSTOMIZE_SYNC_BUTTON_LABEL }, |
119 { "defaultSearchManageEngines", IDS_OPTIONS_DEFAULTSEARCH_MANAGE_ENGINES }, | 119 { "defaultSearchManageEngines", IDS_OPTIONS_DEFAULTSEARCH_MANAGE_ENGINES }, |
120 { "homePageTitle", IDS_OPTIONS2_HOMEPAGE_TITLE }, | 120 { "homePageTitle", IDS_OPTIONS2_HOMEPAGE_TITLE }, |
121 { "homepageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB }, | 121 { "homepageUseNewTab", IDS_OPTIONS_HOMEPAGE_USE_NEWTAB }, |
122 { "homepageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL }, | 122 { "homepageUseURL", IDS_OPTIONS_HOMEPAGE_USE_URL }, |
123 { "instantConfirmMessage", IDS_INSTANT_OPT_IN_MESSAGE }, | 123 { "instantConfirmMessage", IDS_INSTANT_OPT_IN_MESSAGE }, |
124 { "instantConfirmTitle", IDS_INSTANT_OPT_IN_TITLE }, | 124 { "instantConfirmTitle", IDS_INSTANT_OPT_IN_TITLE }, |
125 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, | 125 { "importData", IDS_OPTIONS_IMPORT_DATA_BUTTON }, |
126 { "manageDataDescription", IDS_OPTIONS_MANAGE_DATA_DESCRIPTION }, | 126 { "manageDataDescription", IDS_OPTIONS_MANAGE_DATA_DESCRIPTION }, |
127 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, | 127 { "profilesCreate", IDS_PROFILES_CREATE_BUTTON_LABEL }, |
128 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, | 128 { "profilesDelete", IDS_PROFILES_DELETE_BUTTON_LABEL }, |
129 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, | 129 { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, |
130 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, | 130 { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, |
131 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, | 131 { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, |
132 { "sectionTitleAdvanced", IDS_OPTIONS_ADVANCED_TAB_LABEL }, | 132 { "sectionTitleAdvanced", IDS_OPTIONS_ADVANCED_TAB_LABEL }, |
133 { "sectionTitleAppearance", IDS_APPEARANCE_GROUP_NAME }, | 133 { "sectionTitleAppearance", IDS_APPEARANCE_GROUP_NAME }, |
134 { "sectionTitleDefaultBrowser", IDS_OPTIONS_DEFAULTBROWSER_GROUP_NAME }, | 134 { "sectionTitleDefaultBrowser", IDS_OPTIONS_DEFAULTBROWSER_GROUP_NAME }, |
135 { "sectionTitleUsers", IDS_PROFILES_OPTIONS_GROUP_NAME }, | 135 { "sectionTitleUsers", IDS_PROFILES_OPTIONS_GROUP_NAME }, |
136 { "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME }, | 136 { "sectionTitleSearch", IDS_OPTIONS_DEFAULTSEARCH_GROUP_NAME }, |
137 { "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME }, | 137 { "sectionTitleStartup", IDS_OPTIONS_STARTUP_GROUP_NAME }, |
138 { "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME }, | 138 { "sectionTitleSync", IDS_SYNC_OPTIONS_GROUP_NAME }, |
139 { "sessionRestoreOverlayMessage", IDS_SESSION_RESTORE_OVERLAY_MESSAGE }, | 139 { "sessionRestoreOverlayMessage", IDS_SESSION_RESTORE_OVERLAY_MESSAGE }, |
140 { "sessionRestoreOverlayTitle", IDS_SESSION_RESTORE_OVERLAY_TITLE }, | 140 { "sessionRestoreOverlayTitle", IDS_SESSION_RESTORE_OVERLAY_TITLE }, |
141 { "startupRestoreLastSession", IDS_OPTIONS_STARTUP_RESTORE_LAST_SESSION }, | 141 { "startupRestoreLastSession", IDS_OPTIONS_STARTUP_RESTORE_LAST_SESSION }, |
| 142 { "settingsTitle", IDS_SETTINGS_TITLE }, |
142 { "startupSetPages", IDS_OPTIONS2_STARTUP_SET_PAGES }, | 143 { "startupSetPages", IDS_OPTIONS2_STARTUP_SET_PAGES }, |
143 { "startupShowDefaultAndNewTab", | 144 { "startupShowDefaultAndNewTab", |
144 IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB}, | 145 IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB}, |
145 { "startupShowLastSession", IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION }, | 146 { "startupShowLastSession", IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION }, |
146 { "startupShowPages", IDS_OPTIONS2_STARTUP_SHOW_PAGES }, | 147 { "startupShowPages", IDS_OPTIONS2_STARTUP_SHOW_PAGES }, |
147 { "themesGallery", IDS_THEMES_GALLERY_BUTTON }, | 148 { "themesGallery", IDS_THEMES_GALLERY_BUTTON }, |
148 { "themesGalleryURL", IDS_THEMES_GALLERY_URL }, | 149 { "themesGalleryURL", IDS_THEMES_GALLERY_URL }, |
149 { "toolbarGroupName", IDS_OPTIONS2_TOOLBAR_GROUP_NAME }, | 150 { "toolbarGroupName", IDS_OPTIONS2_TOOLBAR_GROUP_NAME }, |
150 { "toolbarShowBookmarksBar", IDS_OPTIONS_TOOLBAR_SHOW_BOOKMARKS_BAR }, | 151 { "toolbarShowBookmarksBar", IDS_OPTIONS_TOOLBAR_SHOW_BOOKMARKS_BAR }, |
151 { "toolbarShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, | 152 { "toolbarShowHomeButton", IDS_OPTIONS_TOOLBAR_SHOW_HOME_BUTTON }, |
(...skipping 22 matching lines...) Expand all Loading... |
174 { "pointerSensitivityMore", | 175 { "pointerSensitivityMore", |
175 IDS_OPTIONS_SETTINGS_SENSITIVITY_MORE_DESCRIPTION }, | 176 IDS_OPTIONS_SETTINGS_SENSITIVITY_MORE_DESCRIPTION }, |
176 { "pointerSettingsButtonTitle", | 177 { "pointerSettingsButtonTitle", |
177 IDS_OPTIONS_DEVICE_GROUP_POINTER_SETTINGS_BUTTON_TITLE }, | 178 IDS_OPTIONS_DEVICE_GROUP_POINTER_SETTINGS_BUTTON_TITLE }, |
178 { "sectionTitleDevice", IDS_OPTIONS_DEVICE_GROUP_NAME }, | 179 { "sectionTitleDevice", IDS_OPTIONS_DEVICE_GROUP_NAME }, |
179 { "sectionTitleInternet", IDS_OPTIONS_INTERNET_OPTIONS_GROUP_LABEL }, | 180 { "sectionTitleInternet", IDS_OPTIONS_INTERNET_OPTIONS_GROUP_LABEL }, |
180 #endif | 181 #endif |
181 }; | 182 }; |
182 | 183 |
183 RegisterStrings(localized_strings, resources, arraysize(resources)); | 184 RegisterStrings(localized_strings, resources, arraysize(resources)); |
184 RegisterTitle(localized_strings, "browserPage", IDS_SETTINGS_TITLE); | |
185 | 185 |
186 localized_strings->SetString( | 186 localized_strings->SetString( |
187 "syncOverview", | 187 "syncOverview", |
188 l10n_util::GetStringFUTF16(IDS_SYNC_OVERVIEW, | 188 l10n_util::GetStringFUTF16(IDS_SYNC_OVERVIEW, |
189 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); | 189 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); |
190 | 190 |
191 localized_strings->SetString("syncLearnMoreURL", chrome::kSyncLearnMoreURL); | 191 localized_strings->SetString("syncLearnMoreURL", chrome::kSyncLearnMoreURL); |
192 localized_strings->SetString( | 192 localized_strings->SetString( |
193 "profilesSingleUser", | 193 "profilesSingleUser", |
194 l10n_util::GetStringFUTF16(IDS_PROFILES_SINGLE_USER_MESSAGE, | 194 l10n_util::GetStringFUTF16(IDS_PROFILES_SINGLE_USER_MESSAGE, |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 } | 801 } |
802 | 802 |
803 void BrowserOptionsHandler::IncreaseScreenBrightnessCallback( | 803 void BrowserOptionsHandler::IncreaseScreenBrightnessCallback( |
804 const ListValue* args) { | 804 const ListValue* args) { |
805 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 805 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
806 IncreaseScreenBrightness(); | 806 IncreaseScreenBrightness(); |
807 } | 807 } |
808 #endif | 808 #endif |
809 | 809 |
810 } // namespace options2 | 810 } // namespace options2 |
OLD | NEW |