Chromium Code Reviews| Index: chrome/browser/ui/sync/one_click_signin_helper.h |
| diff --git a/chrome/browser/ui/sync/one_click_signin_helper.h b/chrome/browser/ui/sync/one_click_signin_helper.h |
| index 9bc0eab8cce866b40f464535bef18bf5aabb9576..a2634d83fc2760a513abe32f417c53b4d953ffcc 100644 |
| --- a/chrome/browser/ui/sync/one_click_signin_helper.h |
| +++ b/chrome/browser/ui/sync/one_click_signin_helper.h |
| @@ -50,6 +50,12 @@ class OneClickSigninHelper |
| IGNORE_REQUEST |
| }; |
| + // Argument to CanOffer(). |
| + enum CanOfferFor { |
| + CAN_OFFER_FOR_ALL, |
| + CAN_OFFER_FOR_INTERSTITAL_ONLY, |
| + }; |
| + |
| virtual ~OneClickSigninHelper(); |
| // Called only by tests to associate information with a given request. |
| @@ -57,14 +63,22 @@ class OneClickSigninHelper |
| const std::string& email); |
| // Returns true if the one-click signin feature can be offered at this time. |
| - // It can be offered if the contents is not in an incognito window. If |
| - // |check_connected| is true, then the profile is checked to see if it's |
| + // If |email| is not empty, then the profile is checked to see if it's |
| // already connected to a google account or if the user has already rejected |
| // one-click sign-in with this email, in which cases a one click signin |
| // should not be offered. |
| + // |
| + // If |can_offer_for| is |CAN_OFFER_FOR_INTERSTITAL_ONLY|, then only do the |
| + // checks that would affect the intertitial page. Otherwise, do the checks |
|
Andrew T Wilson (Slow)
2012/12/03 14:54:49
intertitial->interstitial
Roger Tawa OOO till Jul 10th
2012/12/03 22:26:54
Done.
|
| + // that would affect the interterial and the explicit sign ins. |
|
Andrew T Wilson (Slow)
2012/12/03 14:54:49
interterial->interstitial
Roger Tawa OOO till Jul 10th
2012/12/03 22:26:54
Done.
|
| + // |
| + // Returns an explanation as a string resource ID for why one-clicked cannot |
| + // be offered in |error_string_id|. |error_string_id| is valid only if |
| + // the return value is false. |
| static bool CanOffer(content::WebContents* web_contents, |
| + CanOfferFor can_offer_for, |
| const std::string& email, |
| - bool check_connected); |
| + int* error_message_id); |
| // Returns true if the one-click signin feature can be offered at this time. |
| // It can be offered if the io_data is not in an incognito window and if the |
| @@ -127,6 +141,11 @@ class OneClickSigninHelper |
| int child_id, |
| int route_id); |
| + void RedirectToNTP(); |
| + |
| + // Clear all data member of the helper, except for the error. |
| + void CleanTransientState(); |
| + |
| // content::WebContentsObserver overrides. |
| virtual void DidNavigateAnyFrame( |
| const content::LoadCommittedDetails& details, |
| @@ -145,6 +164,8 @@ class OneClickSigninHelper |
| std::string password_; |
| AutoAccept auto_accept_; |
| SyncPromoUI::Source source_; |
| + std::string error_message_; |
| + |
| scoped_ptr<SigninTracker> signin_tracker_; |
| DISALLOW_COPY_AND_ASSIGN(OneClickSigninHelper); |