OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/html_viewer/blink_settings_impl.h" | 5 #include "components/html_viewer/blink_settings_impl.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "build/build_config.h" |
8 #include "components/html_viewer/web_preferences.h" | 11 #include "components/html_viewer/web_preferences.h" |
9 #include "third_party/WebKit/public/platform/WebString.h" | 12 #include "third_party/WebKit/public/platform/WebString.h" |
10 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 13 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" |
11 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 14 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
12 #include "third_party/WebKit/public/web/WebSettings.h" | 15 #include "third_party/WebKit/public/web/WebSettings.h" |
13 #include "third_party/WebKit/public/web/WebView.h" | 16 #include "third_party/WebKit/public/web/WebView.h" |
14 #include "third_party/icu/source/common/unicode/uchar.h" | 17 #include "third_party/icu/source/common/unicode/uchar.h" |
15 #include "third_party/icu/source/common/unicode/uscript.h" | 18 #include "third_party/icu/source/common/unicode/uscript.h" |
16 #include "ui/base/touch/touch_device.h" | 19 #include "ui/base/touch/touch_device.h" |
17 #include "ui/base/ui_base_switches_util.h" | 20 #include "ui/base/ui_base_switches_util.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 const base::string16& font, | 131 const base::string16& font, |
129 UScriptCode script) { | 132 UScriptCode script) { |
130 settings->setPictographFontFamily(font, script); | 133 settings->setPictographFontFamily(font, script); |
131 } | 134 } |
132 | 135 |
133 void ApplyFontsFromMap(const ScriptFontFamilyMap& map, | 136 void ApplyFontsFromMap(const ScriptFontFamilyMap& map, |
134 SetFontFamilyWrapper setter, | 137 SetFontFamilyWrapper setter, |
135 blink::WebSettings* settings) { | 138 blink::WebSettings* settings) { |
136 for (ScriptFontFamilyMap::const_iterator it = map.begin(); it != map.end(); | 139 for (ScriptFontFamilyMap::const_iterator it = map.begin(); it != map.end(); |
137 ++it) { | 140 ++it) { |
138 int32 script = u_getPropertyValueEnum(UCHAR_SCRIPT, (it->first).c_str()); | 141 int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, (it->first).c_str()); |
139 if (script >= 0 && script < USCRIPT_CODE_LIMIT) { | 142 if (script >= 0 && script < USCRIPT_CODE_LIMIT) { |
140 UScriptCode code = static_cast<UScriptCode>(script); | 143 UScriptCode code = static_cast<UScriptCode>(script); |
141 (*setter)(settings, it->second, GetScriptForWebSettings(code)); | 144 (*setter)(settings, it->second, GetScriptForWebSettings(code)); |
142 } | 145 } |
143 } | 146 } |
144 } | 147 } |
145 | 148 |
146 } // namespace | 149 } // namespace |
147 | 150 |
148 void BlinkSettingsImpl::ApplySettings(blink::WebView* web_view, | 151 void BlinkSettingsImpl::ApplySettings(blink::WebView* web_view, |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 experimental_webgl_enabled_ = !command_line->HasSwitch(kDisableWebGLSwitch); | 421 experimental_webgl_enabled_ = !command_line->HasSwitch(kDisableWebGLSwitch); |
419 } | 422 } |
420 | 423 |
421 void BlinkSettingsImpl::ApplySettingsToWebView(blink::WebView* view) const { | 424 void BlinkSettingsImpl::ApplySettingsToWebView(blink::WebView* view) const { |
422 WebPreferences prefs; | 425 WebPreferences prefs; |
423 ApplySettings(view, prefs); | 426 ApplySettings(view, prefs); |
424 ApplyFontRendereringSettings(); | 427 ApplyFontRendereringSettings(); |
425 } | 428 } |
426 | 429 |
427 } // namespace html_viewer | 430 } // namespace html_viewer |
OLD | NEW |