| 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_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_ |
| 6 #define CHROME_BROWSER_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_ | 6 #define CHROME_BROWSER_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "components/policy/core/browser/browser_policy_connector.h" | 12 #include "components/policy/core/browser/browser_policy_connector.h" |
| 11 | 13 |
| 12 class PrefService; | 14 class PrefService; |
| 13 | 15 |
| 14 namespace net { | 16 namespace net { |
| 15 class URLRequestContextGetter; | 17 class URLRequestContextGetter; |
| 16 } | 18 } |
| 17 | 19 |
| 18 namespace policy { | 20 namespace policy { |
| 19 | 21 |
| 20 class ConfigurationPolicyProvider; | 22 class ConfigurationPolicyProvider; |
| 21 | 23 |
| 22 // Extends BrowserPolicyConnector with the setup shared among the desktop | 24 // Extends BrowserPolicyConnector with the setup shared among the desktop |
| 23 // implementations and Android. | 25 // implementations and Android. |
| 24 class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { | 26 class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { |
| 25 public: | 27 public: |
| 26 // Service initialization delay time in millisecond on startup. (So that | 28 // Service initialization delay time in millisecond on startup. (So that |
| 27 // displaying Chrome's GUI does not get delayed.) | 29 // displaying Chrome's GUI does not get delayed.) |
| 28 static const int64 kServiceInitializationStartupDelay = 5000; | 30 static const int64_t kServiceInitializationStartupDelay = 5000; |
| 29 | 31 |
| 30 // Builds an uninitialized ChromeBrowserPolicyConnector, suitable for testing. | 32 // Builds an uninitialized ChromeBrowserPolicyConnector, suitable for testing. |
| 31 // Init() should be called to create and start the policy machinery. | 33 // Init() should be called to create and start the policy machinery. |
| 32 ChromeBrowserPolicyConnector(); | 34 ChromeBrowserPolicyConnector(); |
| 33 | 35 |
| 34 ~ChromeBrowserPolicyConnector() override; | 36 ~ChromeBrowserPolicyConnector() override; |
| 35 | 37 |
| 36 void Init( | 38 void Init( |
| 37 PrefService* local_state, | 39 PrefService* local_state, |
| 38 scoped_refptr<net::URLRequestContextGetter> request_context) override; | 40 scoped_refptr<net::URLRequestContextGetter> request_context) override; |
| 39 | 41 |
| 40 private: | 42 private: |
| 41 ConfigurationPolicyProvider* CreatePlatformProvider(); | 43 ConfigurationPolicyProvider* CreatePlatformProvider(); |
| 42 | 44 |
| 43 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserPolicyConnector); | 45 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserPolicyConnector); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 } // namespace policy | 48 } // namespace policy |
| 47 | 49 |
| 48 #endif // CHROME_BROWSER_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_ | 50 #endif // CHROME_BROWSER_POLICY_CHROME_BROWSER_POLICY_CONNECTOR_H_ |
| OLD | NEW |