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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 }; | 407 }; |
408 | 408 |
409 class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { | 409 class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { |
410 public: | 410 public: |
411 static PrefWatcher* GetForProfile(Profile* profile) { | 411 static PrefWatcher* GetForProfile(Profile* profile) { |
412 return static_cast<PrefWatcher*>( | 412 return static_cast<PrefWatcher*>( |
413 GetInstance()->GetServiceForBrowserContext(profile, true)); | 413 GetInstance()->GetServiceForBrowserContext(profile, true)); |
414 } | 414 } |
415 | 415 |
416 static PrefWatcherFactory* GetInstance() { | 416 static PrefWatcherFactory* GetInstance() { |
417 return Singleton<PrefWatcherFactory>::get(); | 417 return base::Singleton<PrefWatcherFactory>::get(); |
418 } | 418 } |
419 | 419 |
420 private: | 420 private: |
421 friend struct DefaultSingletonTraits<PrefWatcherFactory>; | 421 friend struct base::DefaultSingletonTraits<PrefWatcherFactory>; |
422 | 422 |
423 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( | 423 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( |
424 "PrefWatcher", | 424 "PrefWatcher", |
425 BrowserContextDependencyManager::GetInstance()) { | 425 BrowserContextDependencyManager::GetInstance()) { |
426 } | 426 } |
427 | 427 |
428 ~PrefWatcherFactory() override {} | 428 ~PrefWatcherFactory() override {} |
429 | 429 |
430 // BrowserContextKeyedServiceFactory: | 430 // BrowserContextKeyedServiceFactory: |
431 KeyedService* BuildServiceInstanceFor( | 431 KeyedService* BuildServiceInstanceFor( |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 } | 669 } |
670 } | 670 } |
671 | 671 |
672 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { | 672 void PrefsTabHelper::OnWebPrefChanged(const std::string& pref_name) { |
673 #if !defined(OS_ANDROID) | 673 #if !defined(OS_ANDROID) |
674 OnFontFamilyPrefChanged(pref_name); | 674 OnFontFamilyPrefChanged(pref_name); |
675 #endif | 675 #endif |
676 | 676 |
677 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 677 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
678 } | 678 } |
OLD | NEW |