#include "base/gtest_prod_util.h"
#include "base/memory/weak_ptr.h"
-#include "chrome/browser/signin/signin_oauth_helper.h"
#include "chrome/browser/signin/signin_promo.h"
#include "chrome/browser/sync/profile_sync_service_observer.h"
#include "chrome/browser/ui/sync/one_click_signin_sync_starter.h"
+#include "components/signin/core/browser/signin_oauth_helper.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
class Browser;
class GURL;
-class PasswordManager;
class ProfileIOData;
namespace autofill {
class URLRequest;
}
+namespace password_manager {
+class PasswordManager;
+}
+
// Per-tab one-click signin helper. When a user signs in to a Google service
// and the profile is not yet connected to a Google account, will start the
// process of helping the user connect his profile with one click. The process
// more about what this means.
class OneClickSigninHelper
: public content::WebContentsObserver,
- public content::WebContentsUserData<OneClickSigninHelper>,
- public ProfileSyncServiceObserver {
+ public content::WebContentsUserData<OneClickSigninHelper> {
public:
// Represents user's decision about sign in process.
enum AutoAccept {
static void CreateForWebContentsWithPasswordManager(
content::WebContents* contents,
- PasswordManager* password_manager);
+ password_manager::PasswordManager* password_manager);
// Returns true if the one-click signin feature can be offered at this time.
// If |email| is not empty, then the profile is checked to see if it's
// 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.
+ // cross account error, and false otherwise.
static bool HandleCrossAccountError(
- content::WebContents* contents,
+ Profile* profile,
const std::string& session_index,
const std::string& email,
const std::string& password,
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(OneClickSigninHelperTest, SigninFailed);
FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperTest,
CleanTransientStateOnNavigate);
- FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperTest,
- RemoveObserverFromProfileSyncService);
FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperIOTest, CanOfferOnIOThread);
FRIEND_TEST_ALL_PREFIXES(OneClickSigninHelperIOTest,
CanOfferOnIOThreadIncognito);
static const int kMaxNavigationsSince;
OneClickSigninHelper(content::WebContents* web_contents,
- PasswordManager* password_manager);
+ password_manager::PasswordManager* password_manager);
virtual ~OneClickSigninHelper();
const content::FrameNavigateParams& params) OVERRIDE;
virtual void DidStopLoading(
content::RenderViewHost* render_view_host) OVERRIDE;
- virtual void WebContentsDestroyed(content::WebContents* contents) OVERRIDE;
-
- // ProfileSyncServiceObserver.
- virtual void OnStateChanged() OVERRIDE;
OneClickSigninSyncStarter::Callback CreateSyncStarterCallback();