OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 void SyncSetupHandler::HandleCloseTimeout(const ListValue* args) { | 1140 void SyncSetupHandler::HandleCloseTimeout(const ListValue* args) { |
1141 CloseSyncSetup(); | 1141 CloseSyncSetup(); |
1142 } | 1142 } |
1143 | 1143 |
1144 void SyncSetupHandler::CloseSyncSetup() { | 1144 void SyncSetupHandler::CloseSyncSetup() { |
1145 // TODO(atwilson): Move UMA tracking of signin events out of sync module. | 1145 // TODO(atwilson): Move UMA tracking of signin events out of sync module. |
1146 ProfileSyncService* sync_service = GetSyncService(); | 1146 ProfileSyncService* sync_service = GetSyncService(); |
1147 if (IsActiveLogin()) { | 1147 if (IsActiveLogin()) { |
1148 // Don't log a cancel event if the sync setup dialog is being | 1148 // Don't log a cancel event if the sync setup dialog is being |
1149 // automatically closed due to an auth error. | 1149 // automatically closed due to an auth error. |
1150 if ((!sync_service || !sync_service->HasSyncSetupCompleted()) && | 1150 if (!sync_service || (!sync_service->HasSyncSetupCompleted() && |
1151 sync_service->GetAuthError().state() == GoogleServiceAuthError::NONE) { | 1151 sync_service->GetAuthError().state() == GoogleServiceAuthError::NONE)) { |
1152 if (signin_tracker_.get()) { | 1152 if (signin_tracker_.get()) { |
1153 ProfileSyncService::SyncEvent( | 1153 ProfileSyncService::SyncEvent( |
1154 ProfileSyncService::CANCEL_DURING_SIGNON); | 1154 ProfileSyncService::CANCEL_DURING_SIGNON); |
1155 } else if (configuring_sync_) { | 1155 } else if (configuring_sync_) { |
1156 ProfileSyncService::SyncEvent( | 1156 ProfileSyncService::SyncEvent( |
1157 ProfileSyncService::CANCEL_DURING_CONFIGURE); | 1157 ProfileSyncService::CANCEL_DURING_CONFIGURE); |
1158 } else { | 1158 } else { |
1159 ProfileSyncService::SyncEvent( | 1159 ProfileSyncService::SyncEvent( |
1160 ProfileSyncService::CANCEL_FROM_SIGNON_WITHOUT_AUTH); | 1160 ProfileSyncService::CANCEL_FROM_SIGNON_WITHOUT_AUTH); |
1161 } | 1161 } |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 1378 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
1379 } | 1379 } |
1380 | 1380 |
1381 void SyncSetupHandler::CloseOverlay() { | 1381 void SyncSetupHandler::CloseOverlay() { |
1382 // Stop a timer to handle timeout in waiting for sync setup. | 1382 // Stop a timer to handle timeout in waiting for sync setup. |
1383 backend_start_timer_.reset(); | 1383 backend_start_timer_.reset(); |
1384 | 1384 |
1385 CloseSyncSetup(); | 1385 CloseSyncSetup(); |
1386 web_ui()->CallJavascriptFunction("OptionsPage.closeOverlay"); | 1386 web_ui()->CallJavascriptFunction("OptionsPage.closeOverlay"); |
1387 } | 1387 } |
OLD | NEW |