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 26 matching lines...) Expand all Loading... |
37 #include "components/prefs/pref_change_registrar.h" | 37 #include "components/prefs/pref_change_registrar.h" |
38 #include "components/prefs/pref_service.h" | 38 #include "components/prefs/pref_service.h" |
39 #include "components/proxy_config/proxy_config_pref_names.h" | 39 #include "components/proxy_config/proxy_config_pref_names.h" |
40 #include "components/strings/grit/components_locale_settings.h" | 40 #include "components/strings/grit/components_locale_settings.h" |
41 #include "content/public/browser/notification_details.h" | 41 #include "content/public/browser/notification_details.h" |
42 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
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 "third_party/icu/source/common/unicode/uchar.h" | 48 #include "third_party/icu/source/common/unicode/uchar.h" |
48 #include "third_party/icu/source/common/unicode/uscript.h" | 49 #include "third_party/icu/source/common/unicode/uscript.h" |
49 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
50 | 51 |
51 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES) | 52 #if defined(OS_POSIX) && !defined(OS_MACOSX) && defined(ENABLE_THEMES) |
52 #include "chrome/browser/themes/theme_service.h" | 53 #include "chrome/browser/themes/theme_service.h" |
53 #include "chrome/browser/themes/theme_service_factory.h" | 54 #include "chrome/browser/themes/theme_service_factory.h" |
54 #endif | 55 #endif |
55 | 56 |
56 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
57 #include "base/win/windows_version.h" | 58 #include "base/win/windows_version.h" |
58 #endif | 59 #endif |
59 | 60 |
60 using content::WebContents; | 61 using content::WebContents; |
61 using content::WebPreferences; | 62 using content::WebPreferences; |
62 | 63 |
63 DEFINE_WEB_CONTENTS_USER_DATA_KEY(PrefsTabHelper); | 64 DEFINE_WEB_CONTENTS_USER_DATA_KEY(PrefsTabHelper); |
64 | 65 |
65 namespace { | 66 namespace { |
66 | 67 |
67 // The list of prefs we want to observe. | 68 // The list of prefs we want to observe. |
68 const char* const kPrefsToObserve[] = { | 69 const char* const kPrefsToObserve[] = { |
69 #if defined(ENABLE_EXTENSIONS) | 70 #if BUILDFLAG(ENABLE_EXTENSIONS) |
70 prefs::kAnimationPolicy, | 71 prefs::kAnimationPolicy, |
71 #endif | 72 #endif |
72 prefs::kDataSaverEnabled, | 73 prefs::kDataSaverEnabled, |
73 prefs::kDefaultCharset, | 74 prefs::kDefaultCharset, |
74 prefs::kDisable3DAPIs, | 75 prefs::kDisable3DAPIs, |
75 prefs::kEnableHyperlinkAuditing, | 76 prefs::kEnableHyperlinkAuditing, |
76 prefs::kWebKitAllowRunningInsecureContent, | 77 prefs::kWebKitAllowRunningInsecureContent, |
77 prefs::kWebKitDefaultFixedFontSize, | 78 prefs::kWebKitDefaultFixedFontSize, |
78 prefs::kWebKitDefaultFontSize, | 79 prefs::kWebKitDefaultFontSize, |
79 prefs::kWebKitDomPasteEnabled, | 80 prefs::kWebKitDomPasteEnabled, |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 } | 672 } |
672 | 673 |
673 void PrefsTabHelper::NotifyWebkitPreferencesChanged( | 674 void PrefsTabHelper::NotifyWebkitPreferencesChanged( |
674 const std::string& pref_name) { | 675 const std::string& pref_name) { |
675 #if !defined(OS_ANDROID) | 676 #if !defined(OS_ANDROID) |
676 OnFontFamilyPrefChanged(pref_name); | 677 OnFontFamilyPrefChanged(pref_name); |
677 #endif | 678 #endif |
678 | 679 |
679 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); | 680 web_contents_->GetRenderViewHost()->OnWebkitPreferencesChanged(); |
680 } | 681 } |
OLD | NEW |