Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: chrome/browser/dom_ui/options/personal_options_handler.cc

Issue 5799001: DOMUI: Temporarily strip trailing colons from section titles until the strings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win build fix. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/options/dom_options_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/dom_options_util.h"
18 #include "chrome/browser/dom_ui/options/options_managed_banner_handler.h" 19 #include "chrome/browser/dom_ui/options/options_managed_banner_handler.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"
(...skipping 19 matching lines...) Expand all
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 dom_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 dom_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 dom_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 dom_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 dom_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 dom_options_util::StripColon(
105 l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME)));
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options/dom_options_util.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698