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 "content/public/common/web_preferences.mojom.h" |
10 #include "third_party/WebKit/public/web/WebSettings.h" | 11 #include "third_party/WebKit/public/web/WebSettings.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), \ |
21 "mismatching enums: " #a) | 22 "mismatching enums: " #a) |
22 | 23 |
23 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_MAC, WebSettings::EditingBehaviorMac); | 24 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_MAC, WebSettings::EditingBehaviorMac); |
24 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_WIN, WebSettings::EditingBehaviorWin); | 25 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_WIN, WebSettings::EditingBehaviorWin); |
25 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_UNIX, WebSettings::EditingBehaviorUnix); | 26 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_UNIX, WebSettings::EditingBehaviorUnix); |
26 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_ANDROID, | 27 STATIC_ASSERT_ENUM(EDITING_BEHAVIOR_ANDROID, |
27 WebSettings::EditingBehaviorAndroid); | 28 WebSettings::EditingBehaviorAndroid); |
28 | 29 |
29 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT, | 30 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT, |
30 WebSettings::V8CacheOptionsDefault); | 31 WebSettings::V8CacheOptionsDefault); |
31 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, WebSettings::V8CacheOptionsNone); | 32 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, WebSettings::V8CacheOptionsNone); |
32 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_PARSE, WebSettings::V8CacheOptionsParse); | 33 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_PARSE, WebSettings::V8CacheOptionsParse); |
33 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, WebSettings::V8CacheOptionsCode); | 34 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, WebSettings::V8CacheOptionsCode); |
34 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST, WebSettings::V8CacheOptionsCode); | 35 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST, WebSettings::V8CacheOptionsCode); |
35 | 36 |
| 37 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_DEFAULT, |
| 38 mojom::V8CacheOptions::V8_CACHE_OPTIONS_DEFAULT); |
| 39 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_NONE, |
| 40 mojom::V8CacheOptions::V8_CACHE_OPTIONS_NONE); |
| 41 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_PARSE, |
| 42 mojom::V8CacheOptions::V8_CACHE_OPTIONS_PARSE); |
| 43 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_CODE, |
| 44 mojom::V8CacheOptions::V8_CACHE_OPTIONS_CODE); |
| 45 STATIC_ASSERT_ENUM(V8_CACHE_OPTIONS_LAST, |
| 46 mojom::V8CacheOptions::V8_CACHE_OPTIONS_LAST); |
| 47 |
36 STATIC_ASSERT_ENUM(ProgressBarCompletion::LOAD_EVENT, | 48 STATIC_ASSERT_ENUM(ProgressBarCompletion::LOAD_EVENT, |
37 WebSettings::ProgressBarCompletion::LoadEvent); | 49 WebSettings::ProgressBarCompletion::LoadEvent); |
38 STATIC_ASSERT_ENUM(ProgressBarCompletion::RESOURCES_BEFORE_DCL, | 50 STATIC_ASSERT_ENUM(ProgressBarCompletion::RESOURCES_BEFORE_DCL, |
39 WebSettings::ProgressBarCompletion::ResourcesBeforeDCL); | 51 WebSettings::ProgressBarCompletion::ResourcesBeforeDCL); |
40 STATIC_ASSERT_ENUM(ProgressBarCompletion::DOM_CONTENT_LOADED, | 52 STATIC_ASSERT_ENUM(ProgressBarCompletion::DOM_CONTENT_LOADED, |
41 WebSettings::ProgressBarCompletion::DOMContentLoaded); | 53 WebSettings::ProgressBarCompletion::DOMContentLoaded); |
42 STATIC_ASSERT_ENUM( | 54 STATIC_ASSERT_ENUM( |
43 ProgressBarCompletion::RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES, | 55 ProgressBarCompletion::RESOURCES_BEFORE_DCL_AND_SAME_ORIGIN_IFRAMES, |
44 WebSettings::ProgressBarCompletion::ResourcesBeforeDCLAndSameOriginIFrames); | 56 WebSettings::ProgressBarCompletion::ResourcesBeforeDCLAndSameOriginIFrames); |
45 | 57 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 pictograph_font_family_map[kCommonScript] = | 240 pictograph_font_family_map[kCommonScript] = |
229 base::ASCIIToUTF16("Times New Roman"); | 241 base::ASCIIToUTF16("Times New Roman"); |
230 } | 242 } |
231 | 243 |
232 WebPreferences::WebPreferences(const WebPreferences& other) = default; | 244 WebPreferences::WebPreferences(const WebPreferences& other) = default; |
233 | 245 |
234 WebPreferences::~WebPreferences() { | 246 WebPreferences::~WebPreferences() { |
235 } | 247 } |
236 | 248 |
237 } // namespace content | 249 } // namespace content |
OLD | NEW |