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

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: comment tweak 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes", 378 web_ui_->CallJavascriptFunction("PersonalOptions.setRegisteredDataTypes",
379 args); 379 args);
380 } else { 380 } else {
381 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection"); 381 web_ui_->CallJavascriptFunction("options.PersonalOptions.hideSyncSection");
382 } 382 }
383 } 383 }
384 384
385 void PersonalOptionsHandler::ShowSyncActionDialog(const ListValue* args) { 385 void PersonalOptionsHandler::ShowSyncActionDialog(const ListValue* args) {
386 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); 386 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
387 DCHECK(service); 387 DCHECK(service);
388 service->ShowErrorUI(); 388 service->ShowErrorUI(web_ui_);
389 } 389 }
390 390
391 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) { 391 void PersonalOptionsHandler::ShowSyncLoginDialog(const ListValue* args) {
392 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); 392 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
393 DCHECK(service); 393 DCHECK(service);
394 service->ShowLoginDialog(); 394 service->ShowLoginDialog(web_ui_);
395 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); 395 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
396 } 396 }
397 397
398 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) { 398 void PersonalOptionsHandler::ShowCustomizeSyncDialog(const ListValue* args) {
399 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService(); 399 ProfileSyncService* service = web_ui_->GetProfile()->GetProfileSyncService();
400 DCHECK(service); 400 DCHECK(service);
401 service->ShowConfigure(false); 401 service->ShowConfigure(web_ui_, false);
402 } 402 }
403 403
404 void PersonalOptionsHandler::ThemesReset(const ListValue* args) { 404 void PersonalOptionsHandler::ThemesReset(const ListValue* args) {
405 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset")); 405 UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset"));
406 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme(); 406 ThemeServiceFactory::GetForProfile(web_ui_->GetProfile())->UseDefaultTheme();
407 } 407 }
408 408
409 #if defined(TOOLKIT_GTK) 409 #if defined(TOOLKIT_GTK)
410 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) { 410 void PersonalOptionsHandler::ThemesSetGTK(const ListValue* args) {
411 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet")); 411 UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet"));
(...skipping 12 matching lines...) Expand all
424 long long timestamp = base::TimeTicks::Now().ToInternalValue(); 424 long long timestamp = base::TimeTicks::Now().ToInternalValue();
425 StringValue image_url( 425 StringValue image_url(
426 StringPrintf("%s%s?id=%lld", 426 StringPrintf("%s%s?id=%lld",
427 chrome::kChromeUIUserImageURL, 427 chrome::kChromeUIUserImageURL,
428 email.c_str(), 428 email.c_str(),
429 timestamp)); 429 timestamp));
430 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture", 430 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture",
431 image_url); 431 image_url);
432 } 432 }
433 } 433 }
434
435 #endif 434 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.cc ('k') | chrome/browser/ui/webui/options/sync_setup_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698