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

Unified Diff: chrome/browser/sync/profile_sync_service.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/sync_setup_flow.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service.cc
===================================================================
--- chrome/browser/sync/profile_sync_service.cc (revision 86339)
+++ chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -43,6 +43,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/time_format.h"
#include "chrome/common/url_constants.h"
+#include "content/browser/webui/web_ui.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
#include "content/common/notification_type.h"
@@ -539,7 +540,7 @@
if (!cros_user_.empty()) {
if (profile_->GetPrefs()->GetBoolean(prefs::kSyncSuppressStart)) {
- ShowConfigure(true);
+ ShowConfigure(NULL, true);
} else {
SetSyncSetupCompleted();
}
@@ -709,7 +710,7 @@
migrator_->MigrateTypes(types);
}
-void ProfileSyncService::ShowLoginDialog() {
+void ProfileSyncService::ShowLoginDialog(WebUI* web_ui) {
if (WizardIsVisible()) {
wizard_.Focus();
// Force the wizard to step to the login screen (which will only actually
@@ -726,10 +727,16 @@
wizard_.Step(SyncSetupWizard::GAIA_LOGIN);
+ if (web_ui) {
+ web_ui->CallJavascriptFunction("options.SyncSetupOverlay.showSyncDialog");
+ } else {
+ BrowserList::GetLastActive()->ShowOptionsTab(chrome::kSyncSetupSubPage);
+ }
+
NotifyObservers();
}
-void ProfileSyncService::ShowErrorUI() {
+void ProfileSyncService::ShowErrorUI(WebUI* web_ui) {
if (IsPassphraseRequired()) {
if (IsUsingSecondaryPassphrase())
PromptForExistingPassphrase();
@@ -745,12 +752,11 @@
error.state() == GoogleServiceAuthError::ACCOUNT_DELETED ||
error.state() == GoogleServiceAuthError::ACCOUNT_DISABLED ||
error.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) {
- ShowLoginDialog();
+ ShowLoginDialog(web_ui);
}
}
-
-void ProfileSyncService::ShowConfigure(bool sync_everything) {
+void ProfileSyncService::ShowConfigure(WebUI* web_ui, bool sync_everything) {
if (WizardIsVisible()) {
wizard_.Focus();
return;
@@ -760,6 +766,11 @@
wizard_.Step(SyncSetupWizard::SYNC_EVERYTHING);
else
wizard_.Step(SyncSetupWizard::CONFIGURE);
+
+ if (web_ui)
+ web_ui->CallJavascriptFunction("options.SyncSetupOverlay.showSyncDialog");
+ else
+ BrowserList::GetLastActive()->ShowOptionsTab(chrome::kSyncSetupSubPage);
}
void ProfileSyncService::PromptForExistingPassphrase() {
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/sync_setup_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698