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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |