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

Side by Side Diff: chrome/browser/translate/translate_accept_languages_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 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 "chrome/browser/translate/translate_accept_languages_factory.h" 5 #include "chrome/browser/translate/translate_accept_languages_factory.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/incognito_helpers.h" 8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
(...skipping 24 matching lines...) Expand all
35 PrefService* prefs) 35 PrefService* prefs)
36 : accept_languages_(prefs, prefs::kAcceptLanguages) {} 36 : accept_languages_(prefs, prefs::kAcceptLanguages) {}
37 37
38 TranslateAcceptLanguagesService::~TranslateAcceptLanguagesService() {} 38 TranslateAcceptLanguagesService::~TranslateAcceptLanguagesService() {}
39 39
40 } // namespace 40 } // namespace
41 41
42 // static 42 // static
43 TranslateAcceptLanguagesFactory* 43 TranslateAcceptLanguagesFactory*
44 TranslateAcceptLanguagesFactory::GetInstance() { 44 TranslateAcceptLanguagesFactory::GetInstance() {
45 return Singleton<TranslateAcceptLanguagesFactory>::get(); 45 return base::Singleton<TranslateAcceptLanguagesFactory>::get();
46 } 46 }
47 47
48 // static 48 // static
49 translate::TranslateAcceptLanguages* 49 translate::TranslateAcceptLanguages*
50 TranslateAcceptLanguagesFactory::GetForBrowserContext( 50 TranslateAcceptLanguagesFactory::GetForBrowserContext(
51 content::BrowserContext* context) { 51 content::BrowserContext* context) {
52 TranslateAcceptLanguagesService* service = 52 TranslateAcceptLanguagesService* service =
53 static_cast<TranslateAcceptLanguagesService*>( 53 static_cast<TranslateAcceptLanguagesService*>(
54 GetInstance()->GetServiceForBrowserContext(context, true)); 54 GetInstance()->GetServiceForBrowserContext(context, true));
55 return &service->accept_languages(); 55 return &service->accept_languages();
(...skipping 10 matching lines...) Expand all
66 content::BrowserContext* browser_context) const { 66 content::BrowserContext* browser_context) const {
67 Profile* profile = Profile::FromBrowserContext(browser_context); 67 Profile* profile = Profile::FromBrowserContext(browser_context);
68 return new TranslateAcceptLanguagesService(profile->GetPrefs()); 68 return new TranslateAcceptLanguagesService(profile->GetPrefs());
69 } 69 }
70 70
71 content::BrowserContext* 71 content::BrowserContext*
72 TranslateAcceptLanguagesFactory::GetBrowserContextToUse( 72 TranslateAcceptLanguagesFactory::GetBrowserContextToUse(
73 content::BrowserContext* context) const { 73 content::BrowserContext* context) const {
74 return chrome::GetBrowserContextRedirectedInIncognito(context); 74 return chrome::GetBrowserContextRedirectedInIncognito(context);
75 } 75 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_accept_languages_factory.h ('k') | chrome/browser/ui/app_list/app_list_prefs_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698