| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/auto_login_infobar_delegate.h" | 5 #include "chrome/browser/ui/auto_login_infobar_delegate.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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // TokenAuth API, and finally redirects the user to the correct page. | 51 // TokenAuth API, and finally redirects the user to the correct page. |
| 52 class AutoLoginRedirector : public UbertokenConsumer, | 52 class AutoLoginRedirector : public UbertokenConsumer, |
| 53 public content::WebContentsObserver { | 53 public content::WebContentsObserver { |
| 54 public: | 54 public: |
| 55 AutoLoginRedirector(content::WebContents* web_contents, | 55 AutoLoginRedirector(content::WebContents* web_contents, |
| 56 const std::string& args); | 56 const std::string& args); |
| 57 virtual ~AutoLoginRedirector(); | 57 virtual ~AutoLoginRedirector(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Overriden from UbertokenConsumer: | 60 // Overriden from UbertokenConsumer: |
| 61 virtual void OnUbertokenSuccess(const std::string& token) OVERRIDE; | 61 virtual void OnUbertokenSuccess(const std::string& token) override; |
| 62 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) OVERRIDE; | 62 virtual void OnUbertokenFailure(const GoogleServiceAuthError& error) override; |
| 63 | 63 |
| 64 // Implementation of content::WebContentsObserver | 64 // Implementation of content::WebContentsObserver |
| 65 virtual void WebContentsDestroyed() OVERRIDE; | 65 virtual void WebContentsDestroyed() override; |
| 66 | 66 |
| 67 // Redirect tab to MergeSession URL, logging the user in and navigating | 67 // Redirect tab to MergeSession URL, logging the user in and navigating |
| 68 // to the desired page. | 68 // to the desired page. |
| 69 void RedirectToMergeSession(const std::string& token); | 69 void RedirectToMergeSession(const std::string& token); |
| 70 | 70 |
| 71 const std::string args_; | 71 const std::string args_; |
| 72 scoped_ptr<UbertokenFetcher> ubertoken_fetcher_; | 72 scoped_ptr<UbertokenFetcher> ubertoken_fetcher_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(AutoLoginRedirector); | 74 DISALLOW_COPY_AND_ASSIGN(AutoLoginRedirector); |
| 75 }; | 75 }; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 RecordHistogramAction(REJECTED); | 231 RecordHistogramAction(REJECTED); |
| 232 button_pressed_ = true; | 232 button_pressed_ = true; |
| 233 return true; | 233 return true; |
| 234 } | 234 } |
| 235 | 235 |
| 236 void AutoLoginInfoBarDelegate::GoogleSignedOut( | 236 void AutoLoginInfoBarDelegate::GoogleSignedOut( |
| 237 const std::string& account_id, | 237 const std::string& account_id, |
| 238 const std::string& username) { | 238 const std::string& username) { |
| 239 infobar()->RemoveSelf(); | 239 infobar()->RemoveSelf(); |
| 240 } | 240 } |
| OLD | NEW |