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

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

Issue 6325016: DOMUI: Revert back to v1 sync UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 sync_service->RemoveObserver(this); 51 sync_service->RemoveObserver(this);
52 } 52 }
53 53
54 void PersonalOptionsHandler::GetLocalizedValues( 54 void PersonalOptionsHandler::GetLocalizedValues(
55 DictionaryValue* localized_strings) { 55 DictionaryValue* localized_strings) {
56 DCHECK(localized_strings); 56 DCHECK(localized_strings);
57 57
58 localized_strings->SetString("syncSection", 58 localized_strings->SetString("syncSection",
59 dom_options_util::StripColon( 59 dom_options_util::StripColon(
60 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME))); 60 l10n_util::GetStringUTF16(IDS_SYNC_OPTIONS_GROUP_NAME)));
61 localized_strings->SetString("customizeSync",
62 l10n_util::GetStringUTF16(IDS_SYNC_CUSTOMIZE_BUTTON_LABEL));
61 localized_strings->SetString("privacyDashboardLink", 63 localized_strings->SetString("privacyDashboardLink",
62 l10n_util::GetStringUTF16(IDS_SYNC_PRIVACY_DASHBOARD_LINK_LABEL)); 64 l10n_util::GetStringUTF16(IDS_SYNC_PRIVACY_DASHBOARD_LINK_LABEL));
63 65
64 localized_strings->SetString("passwords", 66 localized_strings->SetString("passwords",
65 dom_options_util::StripColon( 67 dom_options_util::StripColon(
66 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_GROUP_NAME))); 68 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_GROUP_NAME)));
67 localized_strings->SetString("passwordsAskToSave", 69 localized_strings->SetString("passwordsAskToSave",
68 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_ASKTOSAVE)); 70 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_ASKTOSAVE));
69 localized_strings->SetString("passwordsNeverSave", 71 localized_strings->SetString("passwordsNeverSave",
70 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_NEVERSAVE)); 72 l10n_util::GetStringUTF16(IDS_OPTIONS_PASSWORDS_NEVERSAVE));
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 localized_strings->SetString("syncsessions", 152 localized_strings->SetString("syncsessions",
151 l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_SESSIONS)); 153 l10n_util::GetStringUTF16(IDS_SYNC_DATATYPE_SESSIONS));
152 } 154 }
153 155
154 void PersonalOptionsHandler::RegisterMessages() { 156 void PersonalOptionsHandler::RegisterMessages() {
155 DCHECK(dom_ui_); 157 DCHECK(dom_ui_);
156 dom_ui_->RegisterMessageCallback( 158 dom_ui_->RegisterMessageCallback(
157 "showSyncLoginDialog", 159 "showSyncLoginDialog",
158 NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog)); 160 NewCallback(this, &PersonalOptionsHandler::ShowSyncLoginDialog));
159 dom_ui_->RegisterMessageCallback( 161 dom_ui_->RegisterMessageCallback(
162 "showCustomizeSyncDialog",
163 NewCallback(this, &PersonalOptionsHandler::ShowCustomizeSyncDialog));
164 dom_ui_->RegisterMessageCallback(
160 "themesReset", 165 "themesReset",
161 NewCallback(this, &PersonalOptionsHandler::ThemesReset)); 166 NewCallback(this, &PersonalOptionsHandler::ThemesReset));
162 #if defined(TOOLKIT_GTK) 167 #if defined(TOOLKIT_GTK)
163 dom_ui_->RegisterMessageCallback( 168 dom_ui_->RegisterMessageCallback(
164 "themesSetGTK", 169 "themesSetGTK",
165 NewCallback(this, &PersonalOptionsHandler::ThemesSetGTK)); 170 NewCallback(this, &PersonalOptionsHandler::ThemesSetGTK));
166 #endif 171 #endif
167 dom_ui_->RegisterMessageCallback("updatePreferredDataTypes", 172 dom_ui_->RegisterMessageCallback("updatePreferredDataTypes",
168 NewCallback(this, &PersonalOptionsHandler::OnPreferredDataTypesUpdated)); 173 NewCallback(this, &PersonalOptionsHandler::OnPreferredDataTypesUpdated));
169 } 174 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 dom_ui_->GetProfile()->GetBrowserSignin()->RequestSignin( 322 dom_ui_->GetProfile()->GetBrowserSignin()->RequestSignin(
318 dom_ui_->tab_contents(), UTF8ToUTF16(email), message, this); 323 dom_ui_->tab_contents(), UTF8ToUTF16(email), message, this);
319 #else 324 #else
320 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService(); 325 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
321 DCHECK(service); 326 DCHECK(service);
322 service->ShowLoginDialog(NULL); 327 service->ShowLoginDialog(NULL);
323 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); 328 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
324 #endif 329 #endif
325 } 330 }
326 331
332 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) {
333 ProfileSyncService* service = dom_ui_->GetProfile()->GetProfileSyncService();
334 DCHECK(service);
335 service->ShowConfigure(NULL);
336 }
337
327 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { 338 void PersonalOptionsHandler::ThemesReset(const ListValue* args) {
328 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); 339 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset"));
329 dom_ui_->GetProfile()->ClearTheme(); 340 dom_ui_->GetProfile()->ClearTheme();
330 } 341 }
331 342
332 #if defined(TOOLKIT_GTK) 343 #if defined(TOOLKIT_GTK)
333 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { 344 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) {
334 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); 345 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet"));
335 dom_ui_->GetProfile()->SetNativeTheme(); 346 dom_ui_->GetProfile()->SetNativeTheme();
336 } 347 }
337 #endif 348 #endif
338 349
339 void PersonalOptionsHandler::OnPreferredDataTypesUpdated( 350 void PersonalOptionsHandler::OnPreferredDataTypesUpdated(
340 const ListValue* args) { 351 const ListValue* args) {
341 NotificationService::current()->Notify( 352 NotificationService::current()->Notify(
342 NotificationType::SYNC_DATA_TYPES_UPDATED, 353 NotificationType::SYNC_DATA_TYPES_UPDATED,
343 Source<Profile>(dom_ui_->GetProfile()), 354 Source<Profile>(dom_ui_->GetProfile()),
344 NotificationService::NoDetails()); 355 NotificationService::NoDetails());
345 } 356 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/options/personal_options_handler.h ('k') | chrome/browser/resources/options/personal_options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698