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..a6469367f5da245530a24bf72ecf8d94c6030d3a 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 interstitial page. Otherwise, do the checks |
+ // that would affect the interstitial and the explicit sign ins. |
+ // |
+ // Returns an explanation as a string resource ID for why one-clicked cannot |
Andrew T Wilson (Slow)
2012/12/04 11:14:06
nit: clicked->click
mention that error_message_id
Roger Tawa OOO till Jul 10th
2012/12/04 15:23:25
Done.
|
+ // 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); |