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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 7093004: Sync: Refactor the ProfileSyncService and sync setup flow to remove use of WebUI from PSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes and cleanups. Created 9 years, 6 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.h » ('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
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index 4e8915b4a5b1ebe237ca29e0875468cd3cc341d4..98adf3d1460fec8231087a309e88b5d2116c88b7 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -43,7 +43,6 @@
#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"
@@ -542,7 +541,7 @@ void ProfileSyncService::OnBackendInitialized() {
if (!cros_user_.empty()) {
if (profile_->GetPrefs()->GetBoolean(prefs::kSyncSuppressStart)) {
- ShowConfigure(NULL, true);
+ ShowConfigure(true);
} else {
SetSyncSetupCompleted();
}
@@ -709,7 +708,7 @@ void ProfileSyncService::OnMigrationNeededForTypes(
migrator_->MigrateTypes(types);
}
-void ProfileSyncService::ShowLoginDialog(WebUI* web_ui) {
+void ProfileSyncService::ShowLoginDialog() {
if (WizardIsVisible()) {
wizard_.Focus();
// Force the wizard to step to the login screen (which will only actually
@@ -724,59 +723,44 @@ void ProfileSyncService::ShowLoginDialog(WebUI* web_ui) {
auth_error_time_ = base::TimeTicks(); // Reset auth_error_time_ to null.
}
- ShowSyncSetup(web_ui, SyncSetupWizard::GAIA_LOGIN);
+ ShowSyncSetup(SyncSetupWizard::GAIA_LOGIN);
NotifyObservers();
}
-void ProfileSyncService::ShowErrorUI(WebUI* web_ui) {
- if (IsPassphraseRequired()) {
- if (IsUsingSecondaryPassphrase())
- PromptForExistingPassphrase(web_ui);
- else
- NOTREACHED(); // Migration no longer supported.
-
+void ProfileSyncService::ShowErrorUI() {
+ if (WizardIsVisible()) {
+ wizard_.Focus();
return;
}
- const GoogleServiceAuthError& error = GetAuthError();
- if (error.state() == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS ||
- error.state() == GoogleServiceAuthError::CAPTCHA_REQUIRED ||
- error.state() == GoogleServiceAuthError::ACCOUNT_DELETED ||
- error.state() == GoogleServiceAuthError::ACCOUNT_DISABLED ||
- error.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) {
- ShowLoginDialog(web_ui);
- }
+ ShowSyncSetup(SyncSetupWizard::NONFATAL_ERROR);
}
-void ProfileSyncService::ShowConfigure(WebUI* web_ui, bool sync_everything) {
+void ProfileSyncService::ShowConfigure(bool sync_everything) {
if (WizardIsVisible()) {
wizard_.Focus();
return;
}
if (sync_everything)
- ShowSyncSetup(web_ui, SyncSetupWizard::SYNC_EVERYTHING);
+ ShowSyncSetup(SyncSetupWizard::SYNC_EVERYTHING);
else
- ShowSyncSetup(web_ui, SyncSetupWizard::CONFIGURE);
+ ShowSyncSetup(SyncSetupWizard::CONFIGURE);
}
-void ProfileSyncService::PromptForExistingPassphrase(WebUI* web_ui) {
+void ProfileSyncService::PromptForExistingPassphrase() {
if (WizardIsVisible()) {
wizard_.Focus();
return;
}
- ShowSyncSetup(web_ui, SyncSetupWizard::ENTER_PASSPHRASE);
+ ShowSyncSetup(SyncSetupWizard::ENTER_PASSPHRASE);
}
-void ProfileSyncService::ShowSyncSetup(WebUI* web_ui,
- SyncSetupWizard::State state) {
+void ProfileSyncService::ShowSyncSetup(SyncSetupWizard::State state) {
wizard_.Step(state);
- if (web_ui)
- web_ui->CallJavascriptFunction("options.SyncSetupOverlay.showSyncDialog");
- else
- BrowserList::GetLastActive()->ShowOptionsTab(chrome::kSyncSetupSubPage);
+ BrowserList::GetLastActive()->ShowOptionsTab(chrome::kSyncSetupSubPage);
}
SyncBackendHost::StatusSummary ProfileSyncService::QuerySyncStatusSummary() {
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/browser/sync/sync_setup_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698