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 #include "apps/shell_window_geometry_cache.h" | 5 #include "apps/shell_window_geometry_cache.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/extensions/extension_prefs.h" | 10 #include "chrome/browser/extensions/extension_prefs.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 cache_.erase(extension_id); | 229 cache_.erase(extension_id); |
230 } | 230 } |
231 | 231 |
232 /////////////////////////////////////////////////////////////////////////////// | 232 /////////////////////////////////////////////////////////////////////////////// |
233 // Factory boilerplate | 233 // Factory boilerplate |
234 | 234 |
235 // static | 235 // static |
236 ShellWindowGeometryCache* ShellWindowGeometryCache::Factory::GetForContext( | 236 ShellWindowGeometryCache* ShellWindowGeometryCache::Factory::GetForContext( |
237 content::BrowserContext* context, bool create) { | 237 content::BrowserContext* context, bool create) { |
238 return static_cast<ShellWindowGeometryCache*>( | 238 return static_cast<ShellWindowGeometryCache*>( |
239 GetInstance()->GetServiceForProfile(context, create)); | 239 GetInstance()->GetServiceForBrowserContext(context, create)); |
240 } | 240 } |
241 | 241 |
242 ShellWindowGeometryCache::Factory* | 242 ShellWindowGeometryCache::Factory* |
243 ShellWindowGeometryCache::Factory::GetInstance() { | 243 ShellWindowGeometryCache::Factory::GetInstance() { |
244 return Singleton<ShellWindowGeometryCache::Factory>::get(); | 244 return Singleton<ShellWindowGeometryCache::Factory>::get(); |
245 } | 245 } |
246 | 246 |
247 ShellWindowGeometryCache::Factory::Factory() | 247 ShellWindowGeometryCache::Factory::Factory() |
248 : ProfileKeyedServiceFactory("ShellWindowGeometryCache", | 248 : BrowserContextKeyedServiceFactory( |
249 ProfileDependencyManager::GetInstance()) { | 249 "ShellWindowGeometryCache", |
| 250 BrowserContextDependencyManager::GetInstance()) { |
250 DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); | 251 DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); |
251 } | 252 } |
252 | 253 |
253 ShellWindowGeometryCache::Factory::~Factory() { | 254 ShellWindowGeometryCache::Factory::~Factory() { |
254 } | 255 } |
255 | 256 |
256 ProfileKeyedService* | 257 BrowserContextKeyedService* |
257 ShellWindowGeometryCache::Factory::BuildServiceInstanceFor( | 258 ShellWindowGeometryCache::Factory::BuildServiceInstanceFor( |
258 content::BrowserContext* context) const { | 259 content::BrowserContext* context) const { |
259 Profile* profile = Profile::FromBrowserContext(context); | 260 Profile* profile = Profile::FromBrowserContext(context); |
260 return new ShellWindowGeometryCache( | 261 return new ShellWindowGeometryCache( |
261 profile, | 262 profile, |
262 extensions::ExtensionPrefs::Get(profile)); | 263 extensions::ExtensionPrefs::Get(profile)); |
263 } | 264 } |
264 | 265 |
265 bool ShellWindowGeometryCache::Factory::ServiceIsNULLWhileTesting() const { | 266 bool ShellWindowGeometryCache::Factory::ServiceIsNULLWhileTesting() const { |
266 return false; | 267 return false; |
267 } | 268 } |
268 | 269 |
269 content::BrowserContext* | 270 content::BrowserContext* |
270 ShellWindowGeometryCache::Factory::GetBrowserContextToUse( | 271 ShellWindowGeometryCache::Factory::GetBrowserContextToUse( |
271 content::BrowserContext* context) const { | 272 content::BrowserContext* context) const { |
272 return chrome::GetBrowserContextRedirectedInIncognito(context); | 273 return chrome::GetBrowserContextRedirectedInIncognito(context); |
273 } | 274 } |
274 | 275 |
275 } // namespace apps | 276 } // namespace apps |
OLD | NEW |