| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/login/gaia_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 } | 641 } |
| 642 | 642 |
| 643 void GaiaScreenHandler::StartClearingCookies( | 643 void GaiaScreenHandler::StartClearingCookies( |
| 644 const base::Closure& on_clear_callback) { | 644 const base::Closure& on_clear_callback) { |
| 645 cookies_cleared_ = false; | 645 cookies_cleared_ = false; |
| 646 ProfileHelper* profile_helper = ProfileHelper::Get(); | 646 ProfileHelper* profile_helper = ProfileHelper::Get(); |
| 647 LOG_ASSERT(Profile::FromWebUI(web_ui()) == | 647 LOG_ASSERT(Profile::FromWebUI(web_ui()) == |
| 648 profile_helper->GetSigninProfile()); | 648 profile_helper->GetSigninProfile()); |
| 649 profile_helper->ClearSigninProfile( | 649 profile_helper->ClearSigninProfile( |
| 650 base::Bind(&GaiaScreenHandler::OnCookiesCleared, | 650 base::Bind(&GaiaScreenHandler::OnCookiesCleared, |
| 651 weak_factory_.GetWeakPtr(), | 651 weak_factory_.GetWeakPtr(), on_clear_callback), |
| 652 on_clear_callback)); | 652 StartupUtils::IsWebviewSigninEnabled() ? web_ui()->GetWebContents() |
| 653 : nullptr); |
| 653 } | 654 } |
| 654 | 655 |
| 655 void GaiaScreenHandler::OnCookiesCleared( | 656 void GaiaScreenHandler::OnCookiesCleared( |
| 656 const base::Closure& on_clear_callback) { | 657 const base::Closure& on_clear_callback) { |
| 657 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 658 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 658 cookies_cleared_ = true; | 659 cookies_cleared_ = true; |
| 659 on_clear_callback.Run(); | 660 on_clear_callback.Run(); |
| 660 } | 661 } |
| 661 | 662 |
| 662 void GaiaScreenHandler::ShowSigninScreenForCreds(const std::string& username, | 663 void GaiaScreenHandler::ShowSigninScreenForCreds(const std::string& username, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { | 851 SigninScreenHandlerDelegate* GaiaScreenHandler::Delegate() { |
| 851 DCHECK(signin_screen_handler_); | 852 DCHECK(signin_screen_handler_); |
| 852 return signin_screen_handler_->delegate_; | 853 return signin_screen_handler_->delegate_; |
| 853 } | 854 } |
| 854 | 855 |
| 855 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { | 856 void GaiaScreenHandler::SetSigninScreenHandler(SigninScreenHandler* handler) { |
| 856 signin_screen_handler_ = handler; | 857 signin_screen_handler_ = handler; |
| 857 } | 858 } |
| 858 | 859 |
| 859 } // namespace chromeos | 860 } // namespace chromeos |
| OLD | NEW |