OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 static DriveIntegrationService* GetForProfile(Profile* profile); | 215 static DriveIntegrationService* GetForProfile(Profile* profile); |
216 | 216 |
217 // Returns the DriveIntegrationService that is already associated with | 217 // Returns the DriveIntegrationService that is already associated with |
218 // |profile|, if it is not yet created it will return NULL. | 218 // |profile|, if it is not yet created it will return NULL. |
219 static DriveIntegrationService* FindForProfile(Profile* profile); | 219 static DriveIntegrationService* FindForProfile(Profile* profile); |
220 | 220 |
221 // Returns the DriveIntegrationServiceFactory instance. | 221 // Returns the DriveIntegrationServiceFactory instance. |
222 static DriveIntegrationServiceFactory* GetInstance(); | 222 static DriveIntegrationServiceFactory* GetInstance(); |
223 | 223 |
224 private: | 224 private: |
225 friend struct DefaultSingletonTraits<DriveIntegrationServiceFactory>; | 225 friend struct base::DefaultSingletonTraits<DriveIntegrationServiceFactory>; |
226 | 226 |
227 DriveIntegrationServiceFactory(); | 227 DriveIntegrationServiceFactory(); |
228 ~DriveIntegrationServiceFactory() override; | 228 ~DriveIntegrationServiceFactory() override; |
229 | 229 |
230 // BrowserContextKeyedServiceFactory overrides. | 230 // BrowserContextKeyedServiceFactory overrides. |
231 content::BrowserContext* GetBrowserContextToUse( | 231 content::BrowserContext* GetBrowserContextToUse( |
232 content::BrowserContext* context) const override; | 232 content::BrowserContext* context) const override; |
233 KeyedService* BuildServiceInstanceFor( | 233 KeyedService* BuildServiceInstanceFor( |
234 content::BrowserContext* context) const override; | 234 content::BrowserContext* context) const override; |
235 | 235 |
236 // This is static so it can be set without instantiating the factory. This | 236 // This is static so it can be set without instantiating the factory. This |
237 // allows factory creation to be delayed until it normally happens (on profile | 237 // allows factory creation to be delayed until it normally happens (on profile |
238 // creation) rather than when tests are set up. DriveIntegrationServiceFactory | 238 // creation) rather than when tests are set up. DriveIntegrationServiceFactory |
239 // transitively depends on ExtensionSystemFactory which crashes if created too | 239 // transitively depends on ExtensionSystemFactory which crashes if created too |
240 // soon (i.e. before the BrowserProcess exists). | 240 // soon (i.e. before the BrowserProcess exists). |
241 static FactoryCallback* factory_for_test_; | 241 static FactoryCallback* factory_for_test_; |
242 }; | 242 }; |
243 | 243 |
244 } // namespace drive | 244 } // namespace drive |
245 | 245 |
246 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ | 246 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ |
OLD | NEW |