| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/public/common/web_preferences.h" | 5 #include "content/public/common/web_preferences.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "third_party/WebKit/public/web/WebSettings.h" | 10 #include "third_party/WebKit/public/web/WebSettings.h" |
| 11 #include "third_party/skia/include/core/SkColor.h" |
| 11 | 12 |
| 12 using blink::WebSettings; | 13 using blink::WebSettings; |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 // "Zyyy" is the ISO 15924 script code for undetermined script aka Common. | 17 // "Zyyy" is the ISO 15924 script code for undetermined script aka Common. |
| 17 const char kCommonScript[] = "Zyyy"; | 18 const char kCommonScript[] = "Zyyy"; |
| 18 | 19 |
| 19 #define STATIC_ASSERT_ENUM(a, b) \ | 20 #define STATIC_ASSERT_ENUM(a, b) \ |
| 20 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 21 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 57 |
| 57 STATIC_ASSERT_ENUM(ui::HOVER_TYPE_NONE, blink::HoverTypeNone); | 58 STATIC_ASSERT_ENUM(ui::HOVER_TYPE_NONE, blink::HoverTypeNone); |
| 58 STATIC_ASSERT_ENUM(ui::HOVER_TYPE_ON_DEMAND, blink::HoverTypeOnDemand); | 59 STATIC_ASSERT_ENUM(ui::HOVER_TYPE_ON_DEMAND, blink::HoverTypeOnDemand); |
| 59 STATIC_ASSERT_ENUM(ui::HOVER_TYPE_HOVER, blink::HoverTypeHover); | 60 STATIC_ASSERT_ENUM(ui::HOVER_TYPE_HOVER, blink::HoverTypeHover); |
| 60 | 61 |
| 61 STATIC_ASSERT_ENUM(ViewportStyle::DEFAULT, blink::WebViewportStyle::Default); | 62 STATIC_ASSERT_ENUM(ViewportStyle::DEFAULT, blink::WebViewportStyle::Default); |
| 62 STATIC_ASSERT_ENUM(ViewportStyle::MOBILE, blink::WebViewportStyle::Mobile); | 63 STATIC_ASSERT_ENUM(ViewportStyle::MOBILE, blink::WebViewportStyle::Mobile); |
| 63 STATIC_ASSERT_ENUM(ViewportStyle::TELEVISION, | 64 STATIC_ASSERT_ENUM(ViewportStyle::TELEVISION, |
| 64 blink::WebViewportStyle::Television); | 65 blink::WebViewportStyle::Television); |
| 65 | 66 |
| 67 #ifndef DEFAULT_BACKGROUND_COLOR |
| 68 #define DEFAULT_BACKGROUND_COLOR SK_ColorWHITE |
| 69 #endif |
| 70 |
| 66 WebPreferences::WebPreferences() | 71 WebPreferences::WebPreferences() |
| 67 : default_font_size(16), | 72 : default_font_size(16), |
| 68 default_fixed_font_size(13), | 73 default_fixed_font_size(13), |
| 69 minimum_font_size(0), | 74 minimum_font_size(0), |
| 70 minimum_logical_font_size(6), | 75 minimum_logical_font_size(6), |
| 71 default_encoding("ISO-8859-1"), | 76 default_encoding("ISO-8859-1"), |
| 72 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
| 73 context_menu_on_mouse_up(true), | 78 context_menu_on_mouse_up(true), |
| 74 #else | 79 #else |
| 75 context_menu_on_mouse_up(false), | 80 context_menu_on_mouse_up(false), |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 #elif defined(OS_WIN) | 152 #elif defined(OS_WIN) |
| 148 editing_behavior(EDITING_BEHAVIOR_WIN), | 153 editing_behavior(EDITING_BEHAVIOR_WIN), |
| 149 #elif defined(OS_ANDROID) | 154 #elif defined(OS_ANDROID) |
| 150 editing_behavior(EDITING_BEHAVIOR_ANDROID), | 155 editing_behavior(EDITING_BEHAVIOR_ANDROID), |
| 151 #elif defined(OS_POSIX) | 156 #elif defined(OS_POSIX) |
| 152 editing_behavior(EDITING_BEHAVIOR_UNIX), | 157 editing_behavior(EDITING_BEHAVIOR_UNIX), |
| 153 #else | 158 #else |
| 154 editing_behavior(EDITING_BEHAVIOR_MAC), | 159 editing_behavior(EDITING_BEHAVIOR_MAC), |
| 155 #endif | 160 #endif |
| 156 supports_multiple_windows(true), | 161 supports_multiple_windows(true), |
| 162 default_background_color(DEFAULT_BACKGROUND_COLOR), |
| 157 viewport_enabled(false), | 163 viewport_enabled(false), |
| 158 #if defined(OS_ANDROID) | 164 #if defined(OS_ANDROID) |
| 159 viewport_meta_enabled(true), | 165 viewport_meta_enabled(true), |
| 160 shrinks_viewport_contents_to_fit(true), | 166 shrinks_viewport_contents_to_fit(true), |
| 161 viewport_style(ViewportStyle::MOBILE), | 167 viewport_style(ViewportStyle::MOBILE), |
| 162 always_show_context_menu_on_touch(false), | 168 always_show_context_menu_on_touch(false), |
| 163 #else | 169 #else |
| 164 viewport_meta_enabled(false), | 170 viewport_meta_enabled(false), |
| 165 shrinks_viewport_contents_to_fit(false), | 171 shrinks_viewport_contents_to_fit(false), |
| 166 viewport_style(ViewportStyle::DEFAULT), | 172 viewport_style(ViewportStyle::DEFAULT), |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 pictograph_font_family_map[kCommonScript] = | 236 pictograph_font_family_map[kCommonScript] = |
| 231 base::ASCIIToUTF16("Times New Roman"); | 237 base::ASCIIToUTF16("Times New Roman"); |
| 232 } | 238 } |
| 233 | 239 |
| 234 WebPreferences::WebPreferences(const WebPreferences& other) = default; | 240 WebPreferences::WebPreferences(const WebPreferences& other) = default; |
| 235 | 241 |
| 236 WebPreferences::~WebPreferences() { | 242 WebPreferences::~WebPreferences() { |
| 237 } | 243 } |
| 238 | 244 |
| 239 } // namespace content | 245 } // namespace content |
| OLD | NEW |