// Argument to CanOffer().
enum CanOfferFor {
CAN_OFFER_FOR_ALL,
- CAN_OFFER_FOR_INTERSTITAL_ONLY
+ CAN_OFFER_FOR_INTERSTITAL_ONLY,
+ CAN_OFFER_FOR_SECONDARY_ACCOUNT
+ // TODO(guohui): needs to handle adding secondary account through
+ // interstitial.
};
+ static void LogHistogramValue(signin::Source source, int action);
+
static void CreateForWebContentsWithPasswordManager(
content::WebContents* contents,
PasswordManager* password_manager);
int child_id,
int route_id);
+ // Handles cross account sign in error. If the supplied |email| does not match
+ // the last signed in email of the current profile, then Chrome will show a
+ // confirmation dialog before starting sync. It returns true if there is a
+ // cross ccount error, and false otherwise.
+ static bool HandleCrossAccountError(
+ content::WebContents* contents,
+ const std::string& session_index,
+ const std::string& email,
+ const std::string& password,
+ const std::string& oauth_code,
+ OneClickSigninHelper::AutoAccept auto_accept,
+ signin::Source source,
+ OneClickSigninSyncStarter::StartSyncMode start_mode,
+ OneClickSigninSyncStarter::Callback sync_callback);
+
+ static void RedirectToNtpOrAppsPage(
+ content::WebContents* contents, signin::Source source);
+
+ // If the |source| is not settings page/webstore, redirects to
+ // the NTP/Apps page.
+ static void RedirectToNtpOrAppsPageIfNecessary(
+ content::WebContents* contents, signin::Source source);
+
+ static void ShowSigninErrorBubble(Browser* browser, const std::string& error);
+
// Remove the item currently at the top of the history list if it's
// the Gaia redirect URL. Due to limitations of the NavigationController
// this cannot be done until a new page becomes "current".
FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperIOTest,
CanOfferOnIOThreadBadURL);
FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperIOTest,
- CanOfferOnIOThreadReferrer);
- FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperIOTest,
CanOfferOnIOThreadDisabled);
FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperIOTest,
CanOfferOnIOThreadSignedIn);
// origin of |url| is a valid Gaia sign in origin. This function is meant
// to called only from the IO thread.
static Offer CanOfferOnIOThreadImpl(const GURL& url,
- const std::string& referrer,
base::SupportsUserData* request,
ProfileIOData* io_data);
int route_id);
void RedirectToSignin();
- void ShowSigninErrorBubble(Browser* browser, const std::string& error);
// Clear all data member of the helper, except for the error.
void CleanTransientState();
void PasswordSubmitted(const autofill::PasswordForm& form);
// content::WebContentsObserver overrides.
- virtual void NavigateToPendingEntry(
+ virtual void DidStartNavigationToPendingEntry(
const GURL& url,
content::NavigationController::ReloadType reload_type) OVERRIDE;
virtual void DidNavigateMainFrame(