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

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

Issue 4821003: DOMUI: Turn the google dashboard link into a real link and fix the behavior of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 10 years, 1 month 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
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 "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 localized_strings->SetString("autofill", 82 localized_strings->SetString("autofill",
83 l10n_util::GetStringUTF16(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME)); 83 l10n_util::GetStringUTF16(IDS_AUTOFILL_SETTING_WINDOWS_GROUP_NAME));
84 localized_strings->SetString("autofill_options", 84 localized_strings->SetString("autofill_options",
85 l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS)); 85 l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS));
86 86
87 localized_strings->SetString("browsing_data", 87 localized_strings->SetString("browsing_data",
88 l10n_util::GetStringUTF16(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME)); 88 l10n_util::GetStringUTF16(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME));
89 localized_strings->SetString("import_data", 89 localized_strings->SetString("import_data",
90 l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON)); 90 l10n_util::GetStringUTF16(IDS_OPTIONS_IMPORT_DATA_BUTTON));
91 91
92 localized_strings->SetString("themes_gallery",
93 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON));
94 localized_strings->SetString("themes_gallery_url",
95 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_URL));
96
92 #if defined(TOOLKIT_GTK) 97 #if defined(TOOLKIT_GTK)
93 localized_strings->SetString("appearance", 98 localized_strings->SetString("appearance",
94 l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME)); 99 l10n_util::GetStringUTF16(IDS_APPEARANCE_GROUP_NAME));
95 localized_strings->SetString("themes_GTK_button", 100 localized_strings->SetString("themes_GTK_button",
96 l10n_util::GetStringUTF16(IDS_THEMES_GTK_BUTTON)); 101 l10n_util::GetStringUTF16(IDS_THEMES_GTK_BUTTON));
97 localized_strings->SetString("themes_set_classic", 102 localized_strings->SetString("themes_set_classic",
98 l10n_util::GetStringUTF16(IDS_THEMES_SET_CLASSIC)); 103 l10n_util::GetStringUTF16(IDS_THEMES_SET_CLASSIC));
99 localized_strings->SetString("showWindow_decorations_radio", 104 localized_strings->SetString("showWindow_decorations_radio",
100 l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO)); 105 l10n_util::GetStringUTF16(IDS_SHOW_WINDOW_DECORATIONS_RADIO));
101 localized_strings->SetString("hideWindow_decorations_radio", 106 localized_strings->SetString("hideWindow_decorations_radio",
102 l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO)); 107 l10n_util::GetStringUTF16(IDS_HIDE_WINDOW_DECORATIONS_RADIO));
103 localized_strings->SetString("themes_gallery",
104 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON));
105 #else 108 #else
106 localized_strings->SetString("themes", 109 localized_strings->SetString("themes",
107 l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME)); 110 l10n_util::GetStringUTF16(IDS_THEMES_GROUP_NAME));
108 localized_strings->SetString("themes_reset", 111 localized_strings->SetString("themes_reset",
109 l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON)); 112 l10n_util::GetStringUTF16(IDS_THEMES_RESET_BUTTON));
110 localized_strings->SetString("themes_gallery",
111 l10n_util::GetStringUTF16(IDS_THEMES_GALLERY_BUTTON));
112 localized_strings->SetString("themes_default", 113 localized_strings->SetString("themes_default",
113 l10n_util::GetStringUTF16(IDS_THEMES_DEFAULT_THEME_LABEL)); 114 l10n_util::GetStringUTF16(IDS_THEMES_DEFAULT_THEME_LABEL));
114 #endif 115 #endif
115 } 116 }
116 117
117 void PersonalOptionsHandler::RegisterMessages() { 118 void PersonalOptionsHandler::RegisterMessages() {
118 DCHECK(dom_ui_); 119 DCHECK(dom_ui_);
119 dom_ui_->RegisterMessageCallback( 120 dom_ui_->RegisterMessageCallback(
120 "showSyncLoginDialog", 121 "showSyncLoginDialog",
121 NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog)); 122 NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog));
122 dom_ui_->RegisterMessageCallback( 123 dom_ui_->RegisterMessageCallback(
123 "openPrivacyDashboardTabAndActivate",
124 NewCallback(this,
125 &PersonalOptionsHandler::OpenPrivacyDashboardTabAndActivate));
126 dom_ui_->RegisterMessageCallback(
127 "themesReset", 124 "themesReset",
128 NewCallback(this, &PersonalOptionsHandler::ThemesReset)); 125 NewCallback(this, &PersonalOptionsHandler::ThemesReset));
129 dom_ui_->RegisterMessageCallback(
130 "themesGallery",
131 NewCallback(this, &PersonalOptionsHandler::ThemesGallery));
132 #if defined(TOOLKIT_GTK) 126 #if defined(TOOLKIT_GTK)
133 dom_ui_->RegisterMessageCallback( 127 dom_ui_->RegisterMessageCallback(
134 "themesSetGTK", 128 "themesSetGTK",
135 NewCallback(this, &PersonalOptionsHandler::ThemesSetGTK)); 129 NewCallback(this, &PersonalOptionsHandler::ThemesSetGTK));
136 #endif 130 #endif
137 } 131 }
138 132
139 void PersonalOptionsHandler::Observe(NotificationType type, 133 void PersonalOptionsHandler::Observe(NotificationType type,
140 const NotificationSource& source, 134 const NotificationSource& source,
141 const NotificationDetails& details) { 135 const NotificationDetails& details) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 OnStateChanged(); 266 OnStateChanged();
273 } 267 }
274 } 268 }
275 269
276 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) { 270 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) {
277 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService(); 271 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
278 service->ShowLoginDialog(NULL); 272 service->ShowLoginDialog(NULL);
279 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); 273 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
280 } 274 }
281 275
282 void PersonalOptionsHandler::OpenPrivacyDashboardTabAndActivate(
283 const ListValue* args) {
284 BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate();
285 }
286
287 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { 276 void PersonalOptionsHandler::ThemesReset(const ListValue* args) {
288 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); 277 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset"));
289 dom_ui_->GetProfile()->ClearTheme(); 278 dom_ui_->GetProfile()->ClearTheme();
290 } 279 }
291 280
292 void PersonalOptionsHandler::ThemesGallery(const ListValue* args) {
293 UserMetricsRecordAction(UserMetricsAction("Options_ThemesGallery"));
294 BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate();
295 }
296
297 #if defined(TOOLKIT_GTK) 281 #if defined(TOOLKIT_GTK)
298 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { 282 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) {
299 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); 283 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet"));
300 dom_ui_->GetProfile()->SetNativeTheme(); 284 dom_ui_->GetProfile()->SetNativeTheme();
301 } 285 }
302 #endif 286 #endif
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options/personal_options_handler.h ('k') | chrome/browser/resources/options/personal_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698