OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ |
6 #define CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ | 6 #define CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "components/signin/core/browser/signin_client.h" | 10 #include "components/signin/core/browser/signin_client.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 static bool SettingsAllowSigninCookies(CookieSettings* cookie_settings); | 27 static bool SettingsAllowSigninCookies(CookieSettings* cookie_settings); |
28 | 28 |
29 // Tracks the privileged signin process identified by |host_id| so that we | 29 // Tracks the privileged signin process identified by |host_id| so that we |
30 // can later ask (via IsSigninProcess) if it is safe to sign the user in from | 30 // can later ask (via IsSigninProcess) if it is safe to sign the user in from |
31 // the current context (see OneClickSigninHelper). All of this tracking | 31 // the current context (see OneClickSigninHelper). All of this tracking |
32 // state is reset once the renderer process terminates. | 32 // state is reset once the renderer process terminates. |
33 // | 33 // |
34 // N.B. This is the id returned by RenderProcessHost::GetID(). | 34 // N.B. This is the id returned by RenderProcessHost::GetID(). |
35 // TODO(guohui): Eliminate these APIs once the web-based signin flow is | 35 // TODO(guohui): Eliminate these APIs once the web-based signin flow is |
36 // replaced by a native flow. crbug.com/347247 | 36 // replaced by a native flow. crbug.com/347247 |
37 virtual void SetSigninProcess(int host_id) OVERRIDE; | 37 virtual void SetSigninProcess(int host_id) override; |
38 virtual void ClearSigninProcess() OVERRIDE; | 38 virtual void ClearSigninProcess() override; |
39 virtual bool IsSigninProcess(int host_id) const OVERRIDE; | 39 virtual bool IsSigninProcess(int host_id) const override; |
40 virtual bool HasSigninProcess() const OVERRIDE; | 40 virtual bool HasSigninProcess() const override; |
41 | 41 |
42 // content::RenderProcessHostObserver implementation. | 42 // content::RenderProcessHostObserver implementation. |
43 virtual void RenderProcessHostDestroyed(content::RenderProcessHost* host) | 43 virtual void RenderProcessHostDestroyed(content::RenderProcessHost* host) |
44 OVERRIDE; | 44 override; |
45 | 45 |
46 // SigninClient implementation. | 46 // SigninClient implementation. |
47 virtual PrefService* GetPrefs() OVERRIDE; | 47 virtual PrefService* GetPrefs() override; |
48 virtual scoped_refptr<TokenWebData> GetDatabase() OVERRIDE; | 48 virtual scoped_refptr<TokenWebData> GetDatabase() override; |
49 virtual bool CanRevokeCredentials() OVERRIDE; | 49 virtual bool CanRevokeCredentials() override; |
50 virtual std::string GetSigninScopedDeviceId() OVERRIDE; | 50 virtual std::string GetSigninScopedDeviceId() override; |
51 virtual void ClearSigninScopedDeviceId() OVERRIDE; | 51 virtual void ClearSigninScopedDeviceId() override; |
52 virtual net::URLRequestContextGetter* GetURLRequestContext() OVERRIDE; | 52 virtual net::URLRequestContextGetter* GetURLRequestContext() override; |
53 virtual bool ShouldMergeSigninCredentialsIntoCookieJar() OVERRIDE; | 53 virtual bool ShouldMergeSigninCredentialsIntoCookieJar() override; |
54 virtual bool IsFirstRun() const OVERRIDE; | 54 virtual bool IsFirstRun() const override; |
55 virtual base::Time GetInstallDate() OVERRIDE; | 55 virtual base::Time GetInstallDate() override; |
56 | 56 |
57 // Returns a string describing the chrome version environment. Version format: | 57 // Returns a string describing the chrome version environment. Version format: |
58 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> | 58 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> |
59 // If version information is unavailable, returns "invalid." | 59 // If version information is unavailable, returns "invalid." |
60 virtual std::string GetProductVersion() OVERRIDE; | 60 virtual std::string GetProductVersion() override; |
61 virtual scoped_ptr<CookieChangedCallbackList::Subscription> | 61 virtual scoped_ptr<CookieChangedCallbackList::Subscription> |
62 AddCookieChangedCallback(const CookieChangedCallback& callback) OVERRIDE; | 62 AddCookieChangedCallback(const CookieChangedCallback& callback) override; |
63 virtual void GoogleSigninSucceeded(const std::string& account_id, | 63 virtual void GoogleSigninSucceeded(const std::string& account_id, |
64 const std::string& username, | 64 const std::string& username, |
65 const std::string& password) OVERRIDE; | 65 const std::string& password) override; |
66 | 66 |
67 // content::NotificationObserver implementation. | 67 // content::NotificationObserver implementation. |
68 virtual void Observe(int type, | 68 virtual void Observe(int type, |
69 const content::NotificationSource& source, | 69 const content::NotificationSource& source, |
70 const content::NotificationDetails& details) OVERRIDE; | 70 const content::NotificationDetails& details) override; |
71 | 71 |
72 private: | 72 private: |
73 void RegisterForCookieChangedNotification(); | 73 void RegisterForCookieChangedNotification(); |
74 void UnregisterForCookieChangedNotification(); | 74 void UnregisterForCookieChangedNotification(); |
75 | 75 |
76 Profile* profile_; | 76 Profile* profile_; |
77 content::NotificationRegistrar registrar_; | 77 content::NotificationRegistrar registrar_; |
78 | 78 |
79 // The callbacks that will be called when notifications about cookie changes | 79 // The callbacks that will be called when notifications about cookie changes |
80 // are received. | 80 // are received. |
81 base::CallbackList<void(const net::CanonicalCookie* cookie)> callbacks_; | 81 base::CallbackList<void(const net::CanonicalCookie* cookie)> callbacks_; |
82 | 82 |
83 // See SetSigninProcess. Tracks the currently active signin process | 83 // See SetSigninProcess. Tracks the currently active signin process |
84 // by ID, if there is one. | 84 // by ID, if there is one. |
85 int signin_host_id_; | 85 int signin_host_id_; |
86 | 86 |
87 // The RenderProcessHosts being observed. | 87 // The RenderProcessHosts being observed. |
88 std::set<content::RenderProcessHost*> signin_hosts_observed_; | 88 std::set<content::RenderProcessHost*> signin_hosts_observed_; |
89 | 89 |
90 DISALLOW_COPY_AND_ASSIGN(ChromeSigninClient); | 90 DISALLOW_COPY_AND_ASSIGN(ChromeSigninClient); |
91 }; | 91 }; |
92 | 92 |
93 #endif // CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ | 93 #endif // CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_CLIENT_H_ |
OLD | NEW |