Chromium Code Reviews| 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/options/personal_options_handler.h" | 5 #include "chrome/browser/dom_ui/options/personal_options_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/browser_list.h" | 17 #include "chrome/browser/browser_list.h" |
| 18 #include "chrome/browser/dom_ui/options/options_managed_banner_handler.h" | 18 #include "chrome/browser/dom_ui/options/options_managed_banner_handler.h" |
| 19 #include "chrome/browser/dom_ui/options/options_util.h" | |
| 19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/browser/sync/profile_sync_service.h" | 22 #include "chrome/browser/sync/profile_sync_service.h" |
| 22 #include "chrome/browser/sync/sync_ui_util.h" | 23 #include "chrome/browser/sync/sync_ui_util.h" |
| 23 #include "chrome/browser/themes/browser_theme_provider.h" | 24 #include "chrome/browser/themes/browser_theme_provider.h" |
| 24 #include "chrome/browser/ui/options/options_page_base.h" | 25 #include "chrome/browser/ui/options/options_page_base.h" |
| 25 #include "chrome/browser/ui/options/options_window.h" | 26 #include "chrome/browser/ui/options/options_window.h" |
| 26 #include "chrome/common/net/gaia/google_service_auth_error.h" | 27 #include "chrome/common/net/gaia/google_service_auth_error.h" |
| 27 #include "chrome/common/notification_service.h" | 28 #include "chrome/common/notification_service.h" |
| 28 #include "chrome/common/chrome_paths.h" | 29 #include "chrome/common/chrome_paths.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 47 dom_ui_->GetProfile()->GetProfileSyncService(); | 48 dom_ui_->GetProfile()->GetProfileSyncService(); |
| 48 if (sync_service) | 49 if (sync_service) |
| 49 sync_service->RemoveObserver(this); | 50 sync_service->RemoveObserver(this); |
| 50 } | 51 } |
| 51 | 52 |
| 52 void PersonalOptionsHandler::GetLocalizedValues( | 53 void PersonalOptionsHandler::GetLocalizedValues( |
| 53 DictionaryValue* localized_strings) { | 54 DictionaryValue* localized_strings) { |
| 54 DCHECK(localized_strings); | 55 DCHECK(localized_strings); |
| 55 | 56 |
| 56 localized_strings->SetString("syncSection", | 57 localized_strings->SetString("syncSection", |
| 57 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME)); | 58 options_util::StripColon( |
| 59 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME))); | |
| 58 localized_strings->SetString("privacyDashboardLink", | 60 localized_strings->SetString("privacyDashboardLink", |
| 59 l10n_util::GetStringUTF16(IDS_SYNC_PRIVACY_DASHBOARD_LINK_LABEL)); | 61 l10n_util::GetStringUTF16(IDS_SYNC_PRIVACY_DASHBOARD_LINK_LABEL)); |
| 60 | 62 |
| 61 localized_strings->SetString("passwords", | 63 localized_strings->SetString("passwords", |
| 62 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_GROUP_NAME)); | 64 options_util::StripColon( |
| 65 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_GROUP_NAME))); | |
| 63 localized_strings->SetString("passwordsAskToSave", | 66 localized_strings->SetString("passwordsAskToSave", |
| 64 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_ASKTOSAVE)); | 67 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_ASKTOSAVE)); |
| 65 localized_strings->SetString("passwordsNeverSave", | 68 localized_strings->SetString("passwordsNeverSave", |
| 66 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_NEVERSAVE)); | 69 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_NEVERSAVE)); |
| 67 localized_strings->SetString("manage_passwords", | 70 localized_strings->SetString("manage_passwords", |
| 68 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS)); | 71 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_MANAGE_PASSWORDS)); |
| 69 | 72 |
| 70 localized_strings->SetString("autofill", | 73 localized_strings->SetString("autofill", |
| 71 l10n_util::GetStringUTF16(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME)); | 74 options_util::StripColon( |
| 75 l10n_util::GetStringUTF16(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME))); | |
| 72 localized_strings->SetString("manageAutofillSettings", | 76 localized_strings->SetString("manageAutofillSettings", |
| 73 l10n_util::GetStringUTF16(IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS)); | 77 l10n_util::GetStringUTF16(IDS_OPTIONS_MANAGE_AUTOFILL_SETTINGS)); |
| 74 | 78 |
| 75 localized_strings->SetString("browsingData", | 79 localized_strings->SetString("browsingData", |
| 76 l10n_util::GetStringUTF16(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME)); | 80 options_util::StripColon( |
| 81 l10n_util::GetStringUTF16(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME))); | |
| 77 localized_strings->SetString("importData", | 82 localized_strings->SetString("importData", |
| 78 l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON)); | 83 l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON)); |
| 79 | 84 |
| 80 localized_strings->SetString("themesGallery", | 85 localized_strings->SetString("themesGallery", |
| 81 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON)); | 86 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON)); |
| 82 localized_strings->SetString("themesGalleryURL", | 87 localized_strings->SetString("themesGalleryURL", |
| 83 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_URL)); | 88 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_URL)); |
| 84 | 89 |
| 85 #if defined(TOOLKIT_GTK) | 90 #if defined(TOOLKIT_GTK) |
| 86 localized_strings->SetString("appearance", | 91 localized_strings->SetString("appearance", |
| 87 l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME)); | 92 options_util::StripColon( |
| 93 l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME))); | |
| 88 localized_strings->SetString("themesGTKButton", | 94 localized_strings->SetString("themesGTKButton", |
| 89 l10n_util::GetStringUTF16(IDS_THEMES_GTK_BUTTON)); | 95 l10n_util::GetStringUTF16(IDS_THEMES_GTK_BUTTON)); |
| 90 localized_strings->SetString("themesSetClassic", | 96 localized_strings->SetString("themesSetClassic", |
| 91 l10n_util::GetStringUTF16(IDS_THEMES_SET_CLASSIC)); | 97 l10n_util::GetStringUTF16(IDS_THEMES_SET_CLASSIC)); |
| 92 localized_strings->SetString("showWindowDecorations", | 98 localized_strings->SetString("showWindowDecorations", |
| 93 l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); | 99 l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); |
| 94 localized_strings->SetString("hideWindowDecorations", | 100 localized_strings->SetString("hideWindowDecorations", |
| 95 l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); | 101 l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); |
| 96 #else | 102 #else |
| 97 localized_strings->SetString("themes", | 103 localized_strings->SetString("themes", |
| 98 l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME)); | 104 options_util::StripColon( |
| 105 l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME)); | |
|
csilv
2010/12/11 00:28:35
add missing ')' (courtesy trybot)
James Hawkins
2010/12/11 00:32:19
Done.
| |
| 99 localized_strings->SetString("themesReset", | 106 localized_strings->SetString("themesReset", |
| 100 l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON)); | 107 l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON)); |
| 101 #endif | 108 #endif |
| 102 } | 109 } |
| 103 | 110 |
| 104 void PersonalOptionsHandler::RegisterMessages() { | 111 void PersonalOptionsHandler::RegisterMessages() { |
| 105 DCHECK(dom_ui_); | 112 DCHECK(dom_ui_); |
| 106 dom_ui_->RegisterMessageCallback( | 113 dom_ui_->RegisterMessageCallback( |
| 107 "showSyncLoginDialog", | 114 "showSyncLoginDialog", |
| 108 NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog)); | 115 NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog)); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 #endif | 290 #endif |
| 284 | 291 |
| 285 void PersonalOptionsHandler::OnLoginSuccess() { | 292 void PersonalOptionsHandler::OnLoginSuccess() { |
| 286 OnStateChanged(); | 293 OnStateChanged(); |
| 287 } | 294 } |
| 288 | 295 |
| 289 void PersonalOptionsHandler::OnLoginFailure( | 296 void PersonalOptionsHandler::OnLoginFailure( |
| 290 const GoogleServiceAuthError& error) { | 297 const GoogleServiceAuthError& error) { |
| 291 OnStateChanged(); | 298 OnStateChanged(); |
| 292 } | 299 } |
| OLD | NEW |