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

Side by Side Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add \n 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/ui/prefs/prefs_tab_helper.h" 5 #include "chrome/browser/ui/prefs/prefs_tab_helper.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 }; 422 };
423 423
424 class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { 424 class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
425 public: 425 public:
426 static PrefWatcher* GetForProfile(Profile* profile) { 426 static PrefWatcher* GetForProfile(Profile* profile) {
427 return static_cast<PrefWatcher*>( 427 return static_cast<PrefWatcher*>(
428 GetInstance()->GetServiceForBrowserContext(profile, true)); 428 GetInstance()->GetServiceForBrowserContext(profile, true));
429 } 429 }
430 430
431 static PrefWatcherFactory* GetInstance() { 431 static PrefWatcherFactory* GetInstance() {
432 return Singleton<PrefWatcherFactory>::get(); 432 return base::Singleton<PrefWatcherFactory>::get();
433 } 433 }
434 434
435 private: 435 private:
436 friend struct DefaultSingletonTraits<PrefWatcherFactory>; 436 friend struct base::DefaultSingletonTraits<PrefWatcherFactory>;
437 437
438 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( 438 PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
439 "PrefWatcher", 439 "PrefWatcher",
440 BrowserContextDependencyManager::GetInstance()) { 440 BrowserContextDependencyManager::GetInstance()) {
441 } 441 }
442 442
443 ~PrefWatcherFactory() override {} 443 ~PrefWatcherFactory() override {}
444 444
445 // BrowserContextKeyedServiceFactory: 445 // BrowserContextKeyedServiceFactory:
446 KeyedService* BuildServiceInstanceFor( 446 KeyedService* BuildServiceInstanceFor(
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 } 684 }
685 } 685 }
686 686
687 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { 687 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) {
688 #if !defined(OS_ANDROID) 688 #if !defined(OS_ANDROID)
689 OnFontFamilyPrefChanged(pref_name); 689 OnFontFamilyPrefChanged(pref_name);
690 #endif 690 #endif
691 691
692 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); 692 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged();
693 } 693 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698