| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 }; | 419 }; |
| 420 | 420 |
| 421 class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { | 421 class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { |
| 422 public: | 422 public: |
| 423 static PrefWatcher* GetForProfile(Profile* profile) { | 423 static PrefWatcher* GetForProfile(Profile* profile) { |
| 424 return static_cast<PrefWatcher*>( | 424 return static_cast<PrefWatcher*>( |
| 425 GetInstance()->GetServiceForBrowserContext(profile, true)); | 425 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 426 } | 426 } |
| 427 | 427 |
| 428 static PrefWatcherFactory* GetInstance() { | 428 static PrefWatcherFactory* GetInstance() { |
| 429 return Singleton<PrefWatcherFactory>::get(); | 429 return base::Singleton<PrefWatcherFactory>::get(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 private: | 432 private: |
| 433 friend struct DefaultSingletonTraits<PrefWatcherFactory>; | 433 friend struct base::DefaultSingletonTraits<PrefWatcherFactory>; |
| 434 | 434 |
| 435 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( | 435 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( |
| 436 "PrefWatcher", | 436 "PrefWatcher", |
| 437 BrowserContextDependencyManager::GetInstance()) { | 437 BrowserContextDependencyManager::GetInstance()) { |
| 438 } | 438 } |
| 439 | 439 |
| 440 ~PrefWatcherFactory() override {} | 440 ~PrefWatcherFactory() override {} |
| 441 | 441 |
| 442 // BrowserContextKeyedServiceFactory: | 442 // BrowserContextKeyedServiceFactory: |
| 443 KeyedService* BuildServiceInstanceFor( | 443 KeyedService* BuildServiceInstanceFor( |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 } | 681 } |
| 682 } | 682 } |
| 683 | 683 |
| 684 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { | 684 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { |
| 685 #if !defined(OS_ANDROID) | 685 #if !defined(OS_ANDROID) |
| 686 OnFontFamilyPrefChanged(pref_name); | 686 OnFontFamilyPrefChanged(pref_name); |
| 687 #endif | 687 #endif |
| 688 | 688 |
| 689 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 689 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
| 690 } | 690 } |
| OLD | NEW |