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 #include "extensions/browser/app_window/app_window_registry.h" | 5 #include "extensions/browser/app_window/app_window_registry.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 // static | 233 // static |
234 AppWindowRegistry* AppWindowRegistry::Factory::GetForBrowserContext( | 234 AppWindowRegistry* AppWindowRegistry::Factory::GetForBrowserContext( |
235 content::BrowserContext* context, | 235 content::BrowserContext* context, |
236 bool create) { | 236 bool create) { |
237 return static_cast<AppWindowRegistry*>( | 237 return static_cast<AppWindowRegistry*>( |
238 GetInstance()->GetServiceForBrowserContext(context, create)); | 238 GetInstance()->GetServiceForBrowserContext(context, create)); |
239 } | 239 } |
240 | 240 |
241 AppWindowRegistry::Factory* AppWindowRegistry::Factory::GetInstance() { | 241 AppWindowRegistry::Factory* AppWindowRegistry::Factory::GetInstance() { |
242 return Singleton<AppWindowRegistry::Factory>::get(); | 242 return base::Singleton<AppWindowRegistry::Factory>::get(); |
243 } | 243 } |
244 | 244 |
245 AppWindowRegistry::Factory::Factory() | 245 AppWindowRegistry::Factory::Factory() |
246 : BrowserContextKeyedServiceFactory( | 246 : BrowserContextKeyedServiceFactory( |
247 "AppWindowRegistry", | 247 "AppWindowRegistry", |
248 BrowserContextDependencyManager::GetInstance()) {} | 248 BrowserContextDependencyManager::GetInstance()) {} |
249 | 249 |
250 AppWindowRegistry::Factory::~Factory() {} | 250 AppWindowRegistry::Factory::~Factory() {} |
251 | 251 |
252 KeyedService* AppWindowRegistry::Factory::BuildServiceInstanceFor( | 252 KeyedService* AppWindowRegistry::Factory::BuildServiceInstanceFor( |
253 content::BrowserContext* context) const { | 253 content::BrowserContext* context) const { |
254 return new AppWindowRegistry(context); | 254 return new AppWindowRegistry(context); |
255 } | 255 } |
256 | 256 |
257 bool AppWindowRegistry::Factory::ServiceIsCreatedWithBrowserContext() const { | 257 bool AppWindowRegistry::Factory::ServiceIsCreatedWithBrowserContext() const { |
258 return true; | 258 return true; |
259 } | 259 } |
260 | 260 |
261 bool AppWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { | 261 bool AppWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { |
262 return false; | 262 return false; |
263 } | 263 } |
264 | 264 |
265 content::BrowserContext* AppWindowRegistry::Factory::GetBrowserContextToUse( | 265 content::BrowserContext* AppWindowRegistry::Factory::GetBrowserContextToUse( |
266 content::BrowserContext* context) const { | 266 content::BrowserContext* context) const { |
267 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); | 267 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); |
268 } | 268 } |
269 | 269 |
270 } // namespace extensions | 270 } // namespace extensions |
OLD | NEW |