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

Side by Side Diff: chrome/browser/autocomplete/shortcuts_backend_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
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/autocomplete/shortcuts_backend_factory.h" 5 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h" 9 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h"
10 #include "chrome/browser/history/history_service_factory.h" 10 #include "chrome/browser/history/history_service_factory.h"
(...skipping 20 matching lines...) Expand all
31 31
32 // static 32 // static
33 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfileIfExists( 33 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfileIfExists(
34 Profile* profile) { 34 Profile* profile) {
35 return static_cast<ShortcutsBackend*>( 35 return static_cast<ShortcutsBackend*>(
36 GetInstance()->GetServiceForBrowserContext(profile, false).get()); 36 GetInstance()->GetServiceForBrowserContext(profile, false).get());
37 } 37 }
38 38
39 // static 39 // static
40 ShortcutsBackendFactory* ShortcutsBackendFactory::GetInstance() { 40 ShortcutsBackendFactory* ShortcutsBackendFactory::GetInstance() {
41 return Singleton<ShortcutsBackendFactory>::get(); 41 return base::Singleton<ShortcutsBackendFactory>::get();
42 } 42 }
43 43
44 // static 44 // static
45 scoped_refptr<RefcountedKeyedService> 45 scoped_refptr<RefcountedKeyedService>
46 ShortcutsBackendFactory::BuildProfileForTesting( 46 ShortcutsBackendFactory::BuildProfileForTesting(
47 content::BrowserContext* profile) { 47 content::BrowserContext* profile) {
48 return CreateShortcutsBackend(Profile::FromBrowserContext(profile), false); 48 return CreateShortcutsBackend(Profile::FromBrowserContext(profile), false);
49 } 49 }
50 50
51 // static 51 // static
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 content::BrowserThread::GetMessageLoopProxyForThread( 96 content::BrowserThread::GetMessageLoopProxyForThread(
97 content::BrowserThread::DB), 97 content::BrowserThread::DB),
98 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); 98 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db));
99 #if defined(ENABLE_EXTENSIONS) 99 #if defined(ENABLE_EXTENSIONS)
100 ShortcutsExtensionsManager* extensions_manager = 100 ShortcutsExtensionsManager* extensions_manager =
101 new ShortcutsExtensionsManager(profile); 101 new ShortcutsExtensionsManager(profile);
102 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); 102 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager);
103 #endif 103 #endif
104 return backend->Init() ? backend : nullptr; 104 return backend->Init() ? backend : nullptr;
105 } 105 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_backend_factory.h ('k') | chrome/browser/autofill/personal_data_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698