| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_signin.h" | 5 #include "chrome/browser/browser_signin.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 default: | 271 default: |
| 272 NOTREACHED(); | 272 NOTREACHED(); |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void BrowserSignin::Cancel() { | 276 void BrowserSignin::Cancel() { |
| 277 if (delegate_) { | 277 if (delegate_) { |
| 278 delegate_->OnLoginFailure(GoogleServiceAuthError( | 278 delegate_->OnLoginFailure(GoogleServiceAuthError( |
| 279 GoogleServiceAuthError::REQUEST_CANCELED)); | 279 GoogleServiceAuthError::REQUEST_CANCELED)); |
| 280 GetProfileSyncService()->OnUserCancelledDialog(); |
| 280 } | 281 } |
| 281 OnLoginFinished(); | 282 OnLoginFinished(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 void BrowserSignin::OnLoginFinished() { | 285 void BrowserSignin::OnLoginFinished() { |
| 285 if (html_dialog_ui_delegate_) | 286 if (html_dialog_ui_delegate_) |
| 286 html_dialog_ui_delegate_->ForceDialogClose(); | 287 html_dialog_ui_delegate_->ForceDialogClose(); |
| 287 // The dialog will be deleted by DOMUI due to the dialog close, | 288 // The dialog will be deleted by DOMUI due to the dialog close, |
| 288 // don't hold a reference. | 289 // don't hold a reference. |
| 289 html_dialog_ui_delegate_ = NULL; | 290 html_dialog_ui_delegate_ = NULL; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 315 registrar_.Remove(this, | 316 registrar_.Remove(this, |
| 316 NotificationType::GOOGLE_SIGNIN_SUCCESSFUL, | 317 NotificationType::GOOGLE_SIGNIN_SUCCESSFUL, |
| 317 Source<Profile>(profile_)); | 318 Source<Profile>(profile_)); |
| 318 registrar_.Remove(this, | 319 registrar_.Remove(this, |
| 319 NotificationType::GOOGLE_SIGNIN_FAILED, | 320 NotificationType::GOOGLE_SIGNIN_FAILED, |
| 320 Source<Profile>(profile_)); | 321 Source<Profile>(profile_)); |
| 321 } | 322 } |
| 322 | 323 |
| 323 void BrowserSignin::ShowSigninTabModal(TabContents* tab_contents) { | 324 void BrowserSignin::ShowSigninTabModal(TabContents* tab_contents) { |
| 324 // TODO(johnnyg): Need a linux views implementation for ConstrainedHtmlDialog. | 325 // TODO(johnnyg): Need a linux views implementation for ConstrainedHtmlDialog. |
| 325 #if defined(OS_WIN) || !defined(TOOLKIT_VIEWS) | 326 #if defined(OS_WIN) || defined(OS_CHROMEOS) || !defined(TOOLKIT_VIEWS) |
| 326 html_dialog_ui_delegate_ = CreateHtmlDialogUI(); | 327 html_dialog_ui_delegate_ = CreateHtmlDialogUI(); |
| 327 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile_, | 328 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile_, |
| 328 html_dialog_ui_delegate_, | 329 html_dialog_ui_delegate_, |
| 329 tab_contents); | 330 tab_contents); |
| 330 #endif | 331 #endif |
| 331 } | 332 } |
| OLD | NEW |