Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1025)

Side by Side Diff: chrome/browser/extensions/shell_window_registry.cc

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/browser_process.h" 5 #include "chrome/browser/browser_process.h"
6 #include "chrome/browser/extensions/shell_window_registry.h" 6 #include "chrome/browser/extensions/shell_window_registry.h"
7 #include "chrome/browser/profiles/incognito_helpers.h" 7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile_manager.h" 8 #include "chrome/browser/profiles/profile_manager.h"
9 #include "chrome/browser/ui/extensions/native_app_window.h" 9 #include "chrome/browser/ui/extensions/native_app_window.h"
10 #include "chrome/browser/ui/extensions/shell_window.h" 10 #include "chrome/browser/ui/extensions/shell_window.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 shell_windows_.push_front(shell_window); 249 shell_windows_.push_front(shell_window);
250 } 250 }
251 251
252 /////////////////////////////////////////////////////////////////////////////// 252 ///////////////////////////////////////////////////////////////////////////////
253 // Factory boilerplate 253 // Factory boilerplate
254 254
255 // static 255 // static
256 ShellWindowRegistry* ShellWindowRegistry::Factory::GetForProfile( 256 ShellWindowRegistry* ShellWindowRegistry::Factory::GetForProfile(
257 Profile* profile, bool create) { 257 Profile* profile, bool create) {
258 return static_cast<ShellWindowRegistry*>( 258 return static_cast<ShellWindowRegistry*>(
259 GetInstance()->GetServiceForProfile(profile, create)); 259 GetInstance()->GetServiceForBrowserContext(profile, create));
260 } 260 }
261 261
262 ShellWindowRegistry::Factory* ShellWindowRegistry::Factory::GetInstance() { 262 ShellWindowRegistry::Factory* ShellWindowRegistry::Factory::GetInstance() {
263 return Singleton<ShellWindowRegistry::Factory>::get(); 263 return Singleton<ShellWindowRegistry::Factory>::get();
264 } 264 }
265 265
266 ShellWindowRegistry::Factory::Factory() 266 ShellWindowRegistry::Factory::Factory()
267 : ProfileKeyedServiceFactory("ShellWindowRegistry", 267 : BrowserContextKeyedServiceFactory(
268 ProfileDependencyManager::GetInstance()) { 268 "ShellWindowRegistry",
269 BrowserContextDependencyManager::GetInstance()) {
269 } 270 }
270 271
271 ShellWindowRegistry::Factory::~Factory() { 272 ShellWindowRegistry::Factory::~Factory() {
272 } 273 }
273 274
274 ProfileKeyedService* ShellWindowRegistry::Factory::BuildServiceInstanceFor( 275 BrowserContextKeyedService*
276 ShellWindowRegistry::Factory::BuildServiceInstanceFor(
275 content::BrowserContext* profile) const { 277 content::BrowserContext* profile) const {
276 return new ShellWindowRegistry(static_cast<Profile*>(profile)); 278 return new ShellWindowRegistry(static_cast<Profile*>(profile));
277 } 279 }
278 280
279 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { 281 bool ShellWindowRegistry::Factory::ServiceIsCreatedWithBrowserContext() const {
280 return true; 282 return true;
281 } 283 }
282 284
283 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const { 285 bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() const {
284 return false; 286 return false;
285 } 287 }
286 288
287 content::BrowserContext* ShellWindowRegistry::Factory::GetBrowserContextToUse( 289 content::BrowserContext* ShellWindowRegistry::Factory::GetBrowserContextToUse(
288 content::BrowserContext* context) const { 290 content::BrowserContext* context) const {
289 return chrome::GetBrowserContextRedirectedInIncognito(context); 291 return chrome::GetBrowserContextRedirectedInIncognito(context);
290 } 292 }
291 293
292 } // namespace extensions 294 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698