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

Side by Side Diff: chrome/browser/ui/webui/options/personal_options_handler.cc

Issue 7057038: dom-ui sync: Eliminate jank when customizing sync settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: win/linux tweaks Created 9 years, 7 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/ui/webui/options/personal_options_handler.h" 5 #include "chrome/browser/ui/webui/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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes", 367 web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes",
368 args); 368 args);
369 } else { 369 } else {
370 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection"); 370 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection");
371 } 371 }
372 } 372 }
373 373
374 void PersonalOptionsHandler::ShowSyncActionDialog(const ListValue* args) { 374 void PersonalOptionsHandler::ShowSyncActionDialog(const ListValue* args) {
375 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); 375 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
376 DCHECK(service); 376 DCHECK(service);
377 service->ShowErrorUI(); 377 service->ShowErrorUI(web_ui_);
378 } 378 }
379 379
380 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) { 380 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) {
381 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); 381 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
382 DCHECK(service); 382 DCHECK(service);
383 service->ShowLoginDialog(); 383 service->ShowLoginDialog(web_ui_);
384 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); 384 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
385 } 385 }
386 386
387 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) { 387 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) {
388 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); 388 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
389 DCHECK(service); 389 DCHECK(service);
390 service->ShowConfigure(false); 390 service->ShowConfigure(web_ui_, false);
391 } 391 }
392 392
393 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { 393 void PersonalOptionsHandler::ThemesReset(const ListValue* args) {
394 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); 394 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset"));
395 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme(); 395 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme();
396 } 396 }
397 397
398 #if defined(TOOLKIT_GTK) 398 #if defined(TOOLKIT_GTK)
399 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { 399 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) {
400 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); 400 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet"));
(...skipping 12 matching lines...) Expand all
413 long long timestamp = base::TimeTicks::Now().ToInternalValue(); 413 long long timestamp = base::TimeTicks::Now().ToInternalValue();
414 StringValue image_url( 414 StringValue image_url(
415 StringPrintf("%s%s?id=%lld", 415 StringPrintf("%s%s?id=%lld",
416 chrome::kChromeUIUserImageURL, 416 chrome::kChromeUIUserImageURL,
417 email.c_str(), 417 email.c_str(),
418 timestamp)); 418 timestamp));
419 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture", 419 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture",
420 image_url); 420 image_url);
421 } 421 }
422 } 422 }
423
424 #endif 423 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698