Index: chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc |
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc |
index 4c5b07154172744eb8ea24c84dcfbb0dc5e188ad..8e5200f6ecb1122b512e853f53ef9067f4d13c7a 100644 |
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc |
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc |
@@ -33,7 +33,7 @@ using content::Referrer; |
namespace { |
-// User actions on the sync promo (aka "Sign in to Chrome"). |
+// User actions on the sync promo, i.e., "Sign in to Chrome". |
enum SyncPromoUserFlowActionEnums { |
SYNC_PROMO_VIEWED, |
SYNC_PROMO_LEARN_MORE_CLICKED, |
@@ -55,8 +55,8 @@ enum SyncPromoUserFlowActionEnums { |
}; |
// This was added because of the need to change the existing UMA enum for the |
-// sync promo mid-flight. Ideally these values would be contiguous, but the |
-// real world is not always ideal. |
+// sync promo mid-flight. Ideally these values would be contiguous, but the real |
+// world is not always ideal. |
static bool IsValidUserFlowAction(int action) { |
return (action >= SYNC_PROMO_FIRST_VALID_JS_ACTION && |
action <= SYNC_PROMO_LAST_VALID_JS_ACTION) || |
@@ -67,6 +67,7 @@ static bool IsValidUserFlowAction(int action) { |
SyncPromoHandler::SyncPromoHandler(ProfileManager* profile_manager) |
: SyncSetupHandler(profile_manager), |
+ prefs_(NULL), |
window_already_closed_(false) { |
} |
@@ -99,25 +100,32 @@ void SyncPromoHandler::RegisterMessages() { |
content::NotificationService::AllSources()); |
} |
- web_ui()->RegisterMessageCallback("SyncPromo:Close", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:Close", |
base::Bind(&SyncPromoHandler::HandleCloseSyncPromo, |
base::Unretained(this))); |
- web_ui()->RegisterMessageCallback("SyncPromo:Initialize", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:Initialize", |
base::Bind(&SyncPromoHandler::HandleInitializeSyncPromo, |
base::Unretained(this))); |
- web_ui()->RegisterMessageCallback("SyncPromo:RecordSignInAttempts", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:RecordSignInAttempts", |
base::Bind(&SyncPromoHandler::HandleRecordSignInAttempts, |
base::Unretained(this))); |
- web_ui()->RegisterMessageCallback("SyncPromo:RecordThrobberTime", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:RecordThrobberTime", |
base::Bind(&SyncPromoHandler::HandleRecordThrobberTime, |
base::Unretained(this))); |
- web_ui()->RegisterMessageCallback("SyncPromo:ShowAdvancedSettings", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:ShowAdvancedSettings", |
base::Bind(&SyncPromoHandler::HandleShowAdvancedSettings, |
base::Unretained(this))); |
- web_ui()->RegisterMessageCallback("SyncPromo:UserFlowAction", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:UserFlowAction", |
base::Bind(&SyncPromoHandler::HandleUserFlowAction, |
base::Unretained(this))); |
- web_ui()->RegisterMessageCallback("SyncPromo:UserSkipped", |
+ web_ui()->RegisterMessageCallback( |
+ "SyncPromo:UserSkipped", |
base::Bind(&SyncPromoHandler::HandleUserSkipped, |
base::Unretained(this))); |
SyncSetupHandler::RegisterMessages(); |
@@ -136,9 +144,9 @@ void SyncPromoHandler::DisplayConfigureSync(bool show_advanced, |
SyncSetupHandler::DisplayConfigureSync(true, passphrase_failed); |
} else { |
// If no passphrase is required then skip the configure pane and sync |
- // everything by default. This makes the first run experience simpler. |
- // Note, there's an advanced link in the sync promo that takes users |
- // to Settings where the configure pane is not skipped. |
+ // everything by default. This makes the first run experience simpler. Note, |
+ // there's an advanced link in the sync promo that takes users to Settings |
+ // where the configure pane is not skipped. |
service->OnUserChoseDatatypes(true, syncable::ModelTypeSet()); |
ConfigureSyncDone(); |
} |
@@ -181,9 +189,8 @@ void SyncPromoHandler::HandleCloseSyncPromo(const base::ListValue* args) { |
if (!username.empty()) |
prefs_->SetBoolean(prefs::kSyncPromoShowNTPBubble, true); |
- // If the browser window is being closed then don't try to navigate to |
- // another URL. This prevents the browser window from flashing during |
- // close. |
+ // If the browser window is being closed then don't try to navigate to another |
+ // URL. This prevents the browser window from flashing during close. |
Browser* browser = |
BrowserList::FindBrowserWithWebContents(web_ui()->GetWebContents()); |
if (!browser || !browser->IsAttemptingToCloseBrowser()) { |