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