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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "content/public/browser/render_view_host.h" | 43 #include "content/public/browser/render_view_host.h" |
44 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
45 #include "content/public/common/renderer_preferences.h" | 45 #include "content/public/common/renderer_preferences.h" |
46 #include "content/public/common/web_preferences.h" | 46 #include "content/public/common/web_preferences.h" |
47 #include "extensions/features/features.h" | 47 #include "extensions/features/features.h" |
48 #include "media/media_features.h" | 48 #include "media/media_features.h" |
49 #include "third_party/icu/source/common/unicode/uchar.h" | 49 #include "third_party/icu/source/common/unicode/uchar.h" |
50 #include "third_party/icu/source/common/unicode/uscript.h" | 50 #include "third_party/icu/source/common/unicode/uscript.h" |
51 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
52 | 52 |
53 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES) | 53 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
54 #include "chrome/browser/themes/theme_service.h" | 54 #include "chrome/browser/themes/theme_service.h" |
55 #include "chrome/browser/themes/theme_service_factory.h" | 55 #include "chrome/browser/themes/theme_service_factory.h" |
56 #endif | 56 #endif |
57 | 57 |
58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
59 #include "base/win/windows_version.h" | 59 #include "base/win/windows_version.h" |
60 #endif | 60 #endif |
61 | 61 |
62 using content::WebContents; | 62 using content::WebContents; |
63 using content::WebPreferences; | 63 using content::WebPreferences; |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 483 |
484 PrefWatcher::Get(profile_)->RegisterHelper(this); | 484 PrefWatcher::Get(profile_)->RegisterHelper(this); |
485 } | 485 } |
486 | 486 |
487 content::RendererPreferences* render_prefs = | 487 content::RendererPreferences* render_prefs = |
488 web_contents_->GetMutableRendererPrefs(); | 488 web_contents_->GetMutableRendererPrefs(); |
489 renderer_preferences_util::UpdateFromSystemSettings(render_prefs, | 489 renderer_preferences_util::UpdateFromSystemSettings(render_prefs, |
490 profile_, | 490 profile_, |
491 web_contents_); | 491 web_contents_); |
492 | 492 |
493 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES) | 493 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
494 registrar_.Add(this, | 494 registrar_.Add(this, |
495 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 495 chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
496 content::Source<ThemeService>( | 496 content::Source<ThemeService>( |
497 ThemeServiceFactory::GetForProfile(profile_))); | 497 ThemeServiceFactory::GetForProfile(profile_))); |
498 #endif | 498 #endif |
499 #if defined(USE_AURA) | 499 #if defined(USE_AURA) |
500 registrar_.Add(this, | 500 registrar_.Add(this, |
501 chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED, | 501 chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED, |
502 content::NotificationService::AllSources()); | 502 content::NotificationService::AllSources()); |
503 #endif | 503 #endif |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 } | 597 } |
598 | 598 |
599 // static | 599 // static |
600 void PrefsTabHelper::GetServiceInstance() { | 600 void PrefsTabHelper::GetServiceInstance() { |
601 PrefWatcherFactory::GetInstance(); | 601 PrefWatcherFactory::GetInstance(); |
602 } | 602 } |
603 | 603 |
604 void PrefsTabHelper::Observe(int type, | 604 void PrefsTabHelper::Observe(int type, |
605 const content::NotificationSource& source, | 605 const content::NotificationSource& source, |
606 const content::NotificationDetails& details) { | 606 const content::NotificationDetails& details) { |
607 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES) | 607 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
608 if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) { | 608 if (type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED) { |
609 UpdateRendererPreferences(); | 609 UpdateRendererPreferences(); |
610 return; | 610 return; |
611 } | 611 } |
612 #endif | 612 #endif |
613 | 613 |
614 #if defined(USE_AURA) | 614 #if defined(USE_AURA) |
615 if (type == chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED) { | 615 if (type == chrome::NOTIFICATION_BROWSER_FLING_CURVE_PARAMETERS_CHANGED) { |
616 UpdateRendererPreferences(); | 616 UpdateRendererPreferences(); |
617 return; | 617 return; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 void PrefsTabHelper::NotifyWebkitPreferencesChanged( | 675 void PrefsTabHelper::NotifyWebkitPreferencesChanged( |
676 const std::string& pref_name) { | 676 const std::string& pref_name) { |
677 #if !defined(OS_ANDROID) | 677 #if !defined(OS_ANDROID) |
678 OnFontFamilyPrefChanged(pref_name); | 678 OnFontFamilyPrefChanged(pref_name); |
679 #endif | 679 #endif |
680 | 680 |
681 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 681 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
682 } | 682 } |
OLD | NEW |