Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1394)

Unified Diff: chrome/browser/signin/chrome_signin_client.h

Issue 216703002: Move the SigninProcess APIs from SigninManager to ChromeSigninClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove cruft Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/chrome_signin_client.h
diff --git a/chrome/browser/signin/chrome_signin_client.h b/chrome/browser/signin/chrome_signin_client.h
index d5a4e307edadbf8c8dd1ee5fb4e4dc7893462926..b51bcc065ed191510939f66ba5ed4bd7e3f1606f 100644
--- a/chrome/browser/signin/chrome_signin_client.h
+++ b/chrome/browser/signin/chrome_signin_client.h
@@ -9,11 +9,14 @@
#include "base/compiler_specific.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/signin/core/browser/signin_client.h"
+#include "content/public/browser/render_process_host_observer.h"
class CookieSettings;
class Profile;
-class ChromeSigninClient : public SigninClient, public KeyedService {
+class ChromeSigninClient : public SigninClient,
+ public KeyedService,
+ public content::RenderProcessHostObserver {
public:
explicit ChromeSigninClient(Profile* profile);
virtual ~ChromeSigninClient();
@@ -22,6 +25,23 @@ class ChromeSigninClient : public SigninClient, public KeyedService {
static bool ProfileAllowsSigninCookies(Profile* profile);
static bool SettingsAllowSigninCookies(CookieSettings* cookie_settings);
+ // Tracks the privileged signin process identified by |host_id| so that we
+ // can later ask (via IsSigninProcess) if it is safe to sign the user in from
+ // the current context (see OneClickSigninHelper). All of this tracking
+ // state is reset once the renderer process terminates.
+ //
+ // N.B. This is the id returned by RenderProcessHost::GetID().
+ // TODO(guohui): Eliminate these APIs once the web-based signin flow is
+ // replaced by a native flow. crbug.com/347247
+ void SetSigninProcess(int host_id);
+ void ClearSigninProcess();
+ bool IsSigninProcess(int host_id) const;
+ bool HasSigninProcess() const;
+
+ // content::RenderProcessHostObserver implementation.
+ virtual void RenderProcessHostDestroyed(content::RenderProcessHost* host)
+ OVERRIDE;
+
// SigninClient implementation.
virtual PrefService* GetPrefs() OVERRIDE;
virtual scoped_refptr<TokenWebData> GetDatabase() OVERRIDE;
@@ -33,6 +53,13 @@ class ChromeSigninClient : public SigninClient, public KeyedService {
private:
Profile* profile_;
+ // See SetSigninProcess. Tracks the currently active signin process
+ // by ID, if there is one.
+ int signin_host_id_;
+
+ // The RenderProcessHosts being observed.
+ std::set<content::RenderProcessHost*> signin_hosts_observed_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeSigninClient);
};

Powered by Google App Engine
This is Rietveld 408576698