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/renderer_preferences_util.h" | 5 #include "chrome/browser/renderer_preferences_util.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
11 #include "components/prefs/pref_service.h" | 11 #include "components/prefs/pref_service.h" |
12 #include "content/public/browser/host_zoom_map.h" | |
13 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/renderer_preferences.h" | 13 #include "content/public/common/renderer_preferences.h" |
15 #include "content/public/common/webrtc_ip_handling_policy.h" | 14 #include "content/public/common/webrtc_ip_handling_policy.h" |
16 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
17 | 16 |
18 #if defined(OS_LINUX) || defined(OS_ANDROID) | 17 #if defined(OS_LINUX) || defined(OS_ANDROID) |
19 #include "ui/gfx/font_render_params.h" | 18 #include "ui/gfx/font_render_params.h" |
20 #endif | 19 #endif |
21 | 20 |
22 #if !defined(OS_ANDROID) | |
23 #include "components/ui/zoom/zoom_controller.h" | |
24 #endif | |
25 | |
26 #if defined(TOOLKIT_VIEWS) | 21 #if defined(TOOLKIT_VIEWS) |
27 #include "ui/views/controls/textfield/textfield.h" | 22 #include "ui/views/controls/textfield/textfield.h" |
28 #endif | 23 #endif |
29 | 24 |
30 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 25 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
31 #include "chrome/browser/themes/theme_service.h" | 26 #include "chrome/browser/themes/theme_service.h" |
32 #include "chrome/browser/themes/theme_service_factory.h" | 27 #include "chrome/browser/themes/theme_service_factory.h" |
33 #include "ui/views/linux_ui/linux_ui.h" | 28 #include "ui/views/linux_ui/linux_ui.h" |
34 #endif | 29 #endif |
35 | 30 |
(...skipping 19 matching lines...) Expand all Loading... |
55 prefs->webrtc_ip_handling_policy = | 50 prefs->webrtc_ip_handling_policy = |
56 content::kWebRTCIPHandlingDefaultPublicInterfaceOnly; | 51 content::kWebRTCIPHandlingDefaultPublicInterfaceOnly; |
57 } | 52 } |
58 } | 53 } |
59 if (prefs->webrtc_ip_handling_policy.empty()) { | 54 if (prefs->webrtc_ip_handling_policy.empty()) { |
60 prefs->webrtc_ip_handling_policy = | 55 prefs->webrtc_ip_handling_policy = |
61 pref_service->GetString(prefs::kWebRTCIPHandlingPolicy); | 56 pref_service->GetString(prefs::kWebRTCIPHandlingPolicy); |
62 } | 57 } |
63 #endif | 58 #endif |
64 | 59 |
65 double default_zoom_level = 0; | |
66 bool default_zoom_level_set = false; | |
67 #if !defined(OS_ANDROID) | |
68 ui_zoom::ZoomController* zoom_controller = | |
69 ui_zoom::ZoomController::FromWebContents(web_contents); | |
70 if (zoom_controller) { | |
71 default_zoom_level = zoom_controller->GetDefaultZoomLevel(); | |
72 default_zoom_level_set = true; | |
73 } | |
74 #endif | |
75 | |
76 if (!default_zoom_level_set) { | |
77 default_zoom_level = | |
78 content::HostZoomMap::Get(web_contents->GetSiteInstance()) | |
79 ->GetDefaultZoomLevel(); | |
80 } | |
81 prefs->default_zoom_level = default_zoom_level; | |
82 | |
83 #if defined(USE_DEFAULT_RENDER_THEME) | 60 #if defined(USE_DEFAULT_RENDER_THEME) |
84 prefs->focus_ring_color = SkColorSetRGB(0x4D, 0x90, 0xFE); | 61 prefs->focus_ring_color = SkColorSetRGB(0x4D, 0x90, 0xFE); |
85 #if defined(OS_CHROMEOS) | 62 #if defined(OS_CHROMEOS) |
86 // This color is 0x544d90fe modulated with 0xffffff. | 63 // This color is 0x544d90fe modulated with 0xffffff. |
87 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); | 64 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); |
88 prefs->active_selection_fg_color = SK_ColorBLACK; | 65 prefs->active_selection_fg_color = SK_ColorBLACK; |
89 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); | 66 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); |
90 prefs->inactive_selection_fg_color = SK_ColorBLACK; | 67 prefs->inactive_selection_fg_color = SK_ColorBLACK; |
91 #endif | 68 #endif |
92 #endif | 69 #endif |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 prefs->subpixel_rendering = params.subpixel_rendering; | 105 prefs->subpixel_rendering = params.subpixel_rendering; |
129 #endif | 106 #endif |
130 | 107 |
131 #if !defined(OS_MACOSX) | 108 #if !defined(OS_MACOSX) |
132 prefs->plugin_fullscreen_allowed = | 109 prefs->plugin_fullscreen_allowed = |
133 pref_service->GetBoolean(prefs::kFullscreenAllowed); | 110 pref_service->GetBoolean(prefs::kFullscreenAllowed); |
134 #endif | 111 #endif |
135 } | 112 } |
136 | 113 |
137 } // namespace renderer_preferences_util | 114 } // namespace renderer_preferences_util |
OLD | NEW |