| 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 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class OneClickSigninHelper : public content::WebContentsObserver { | 26 class OneClickSigninHelper : public content::WebContentsObserver { |
| 27 public: | 27 public: |
| 28 // Returns true if the one-click signin feature can be offered at this time. | 28 // Returns true if the one-click signin feature can be offered at this time. |
| 29 // It can be offered if the contents is not in an incognito window. If | 29 // It can be offered if the contents is not in an incognito window. If |
| 30 // |check_connected| is true, then the profile is checked to see if it's | 30 // |check_connected| is true, then the profile is checked to see if it's |
| 31 // already connected to a google account, in which case a one click signin | 31 // already connected to a google account, in which case a one click signin |
| 32 // should not be offered. | 32 // should not be offered. |
| 33 static bool CanOffer(content::WebContents* web_contents, | 33 static bool CanOffer(content::WebContents* web_contents, |
| 34 bool check_connected); | 34 bool check_connected); |
| 35 | 35 |
| 36 // Looks for the X-Google-Accounts-SignIn response header, and if found, | 36 // Looks for the Google-Accounts-SignIn response header, and if found, |
| 37 // tries to display an infobar in the tab contents identified by the | 37 // tries to display an infobar in the tab contents identified by the |
| 38 // child/route id. | 38 // child/route id. |
| 39 static void ShowInfoBarIfPossible(net::URLRequest* request, | 39 static void ShowInfoBarIfPossible(net::URLRequest* request, |
| 40 int child_id, | 40 int child_id, |
| 41 int route_id); | 41 int route_id); |
| 42 | 42 |
| 43 explicit OneClickSigninHelper(content::WebContents* web_contents); | 43 explicit OneClickSigninHelper(content::WebContents* web_contents); |
| 44 virtual ~OneClickSigninHelper(); | 44 virtual ~OneClickSigninHelper(); |
| 45 | 45 |
| 46 private: | 46 private: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 // Information about the account that has just logged in. | 66 // Information about the account that has just logged in. |
| 67 std::string session_index_; | 67 std::string session_index_; |
| 68 std::string email_; | 68 std::string email_; |
| 69 std::string password_; | 69 std::string password_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); | 71 DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ | 74 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_HELPER_H_ |
| OLD | NEW |