| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "webkit/common/webpreferences.h" | 5 #include "content/public/common/webpreferences.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "third_party/WebKit/public/web/WebSettings.h" | 10 #include "third_party/WebKit/public/web/WebSettings.h" |
| 11 #include "third_party/icu/source/common/unicode/uchar.h" | 11 #include "third_party/icu/source/common/unicode/uchar.h" |
| 12 | 12 |
| 13 using base::ASCIIToWide; | 13 using base::ASCIIToWide; |
| 14 using blink::WebSettings; | 14 using blink::WebSettings; |
| 15 | 15 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 device_supports_touch(false), | 93 device_supports_touch(false), |
| 94 device_supports_mouse(true), | 94 device_supports_mouse(true), |
| 95 touch_adjustment_enabled(true), | 95 touch_adjustment_enabled(true), |
| 96 pointer_events_max_touch_points(0), | 96 pointer_events_max_touch_points(0), |
| 97 fixed_position_creates_stacking_context(false), | 97 fixed_position_creates_stacking_context(false), |
| 98 sync_xhr_in_documents_enabled(true), | 98 sync_xhr_in_documents_enabled(true), |
| 99 deferred_image_decoding_enabled(false), | 99 deferred_image_decoding_enabled(false), |
| 100 should_respect_image_orientation(false), | 100 should_respect_image_orientation(false), |
| 101 number_of_cpu_cores(1), | 101 number_of_cpu_cores(1), |
| 102 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
| 103 editing_behavior(webkit_glue::EDITING_BEHAVIOR_MAC), | 103 editing_behavior(content::EDITING_BEHAVIOR_MAC), |
| 104 #elif defined(OS_WIN) | 104 #elif defined(OS_WIN) |
| 105 editing_behavior(webkit_glue::EDITING_BEHAVIOR_WIN), | 105 editing_behavior(content::EDITING_BEHAVIOR_WIN), |
| 106 #elif defined(OS_ANDROID) | 106 #elif defined(OS_ANDROID) |
| 107 editing_behavior(webkit_glue::EDITING_BEHAVIOR_ANDROID), | 107 editing_behavior(content::EDITING_BEHAVIOR_ANDROID), |
| 108 #elif defined(OS_POSIX) | 108 #elif defined(OS_POSIX) |
| 109 editing_behavior(webkit_glue::EDITING_BEHAVIOR_UNIX), | 109 editing_behavior(content::EDITING_BEHAVIOR_UNIX), |
| 110 #else | 110 #else |
| 111 editing_behavior(webkit_glue::EDITING_BEHAVIOR_MAC), | 111 editing_behavior(content::EDITING_BEHAVIOR_MAC), |
| 112 #endif | 112 #endif |
| 113 supports_multiple_windows(true), | 113 supports_multiple_windows(true), |
| 114 viewport_enabled(false), | 114 viewport_enabled(false), |
| 115 viewport_meta_enabled(false), | 115 viewport_meta_enabled(false), |
| 116 main_frame_resizes_are_orientation_changes(false), | 116 main_frame_resizes_are_orientation_changes(false), |
| 117 initialize_at_minimum_page_scale(true), | 117 initialize_at_minimum_page_scale(true), |
| 118 #if defined(OS_MACOSX) | 118 #if defined(OS_MACOSX) |
| 119 smart_insert_delete_enabled(true), | 119 smart_insert_delete_enabled(true), |
| 120 #else | 120 #else |
| 121 smart_insert_delete_enabled(false), | 121 smart_insert_delete_enabled(false), |
| (...skipping 20 matching lines...) Expand all Loading... |
| 142 use_wide_viewport(true), | 142 use_wide_viewport(true), |
| 143 viewport_meta_layout_size_quirk(false), | 143 viewport_meta_layout_size_quirk(false), |
| 144 viewport_meta_merge_content_quirk(false), | 144 viewport_meta_merge_content_quirk(false), |
| 145 viewport_meta_non_user_scalable_quirk(false), | 145 viewport_meta_non_user_scalable_quirk(false), |
| 146 viewport_meta_zero_values_quirk(false), | 146 viewport_meta_zero_values_quirk(false), |
| 147 clobber_user_agent_initial_scale_quirk(false), | 147 clobber_user_agent_initial_scale_quirk(false), |
| 148 ignore_main_frame_overflow_hidden_quirk(false), | 148 ignore_main_frame_overflow_hidden_quirk(false), |
| 149 report_screen_size_in_physical_pixels_quirk(false) | 149 report_screen_size_in_physical_pixels_quirk(false) |
| 150 #endif | 150 #endif |
| 151 { | 151 { |
| 152 standard_font_family_map[webkit_glue::kCommonScript] = | 152 standard_font_family_map[content::kCommonScript] = |
| 153 base::ASCIIToUTF16("Times New Roman"); | 153 base::ASCIIToUTF16("Times New Roman"); |
| 154 fixed_font_family_map[webkit_glue::kCommonScript] = | 154 fixed_font_family_map[content::kCommonScript] = |
| 155 base::ASCIIToUTF16("Courier New"); | 155 base::ASCIIToUTF16("Courier New"); |
| 156 serif_font_family_map[webkit_glue::kCommonScript] = | 156 serif_font_family_map[content::kCommonScript] = |
| 157 base::ASCIIToUTF16("Times New Roman"); | 157 base::ASCIIToUTF16("Times New Roman"); |
| 158 sans_serif_font_family_map[webkit_glue::kCommonScript] = | 158 sans_serif_font_family_map[content::kCommonScript] = |
| 159 base::ASCIIToUTF16("Arial"); | 159 base::ASCIIToUTF16("Arial"); |
| 160 cursive_font_family_map[webkit_glue::kCommonScript] = | 160 cursive_font_family_map[content::kCommonScript] = |
| 161 base::ASCIIToUTF16("Script"); | 161 base::ASCIIToUTF16("Script"); |
| 162 fantasy_font_family_map[webkit_glue::kCommonScript] = | 162 fantasy_font_family_map[content::kCommonScript] = |
| 163 base::ASCIIToUTF16("Impact"); | 163 base::ASCIIToUTF16("Impact"); |
| 164 pictograph_font_family_map[webkit_glue::kCommonScript] = | 164 pictograph_font_family_map[content::kCommonScript] = |
| 165 base::ASCIIToUTF16("Times New Roman"); | 165 base::ASCIIToUTF16("Times New Roman"); |
| 166 } | 166 } |
| 167 | 167 |
| 168 WebPreferences::~WebPreferences() { | 168 WebPreferences::~WebPreferences() { |
| 169 } | 169 } |
| 170 | 170 |
| 171 namespace webkit_glue { | 171 namespace content { |
| 172 | 172 |
| 173 // "Zyyy" is the ISO 15924 script code for undetermined script aka Common. | 173 // "Zyyy" is the ISO 15924 script code for undetermined script aka Common. |
| 174 const char kCommonScript[] = "Zyyy"; | 174 const char kCommonScript[] = "Zyyy"; |
| 175 | 175 |
| 176 #define COMPILE_ASSERT_MATCHING_ENUMS(webkit_glue_name, webkit_name) \ | 176 #define COMPILE_ASSERT_MATCHING_ENUMS(content_name, webkit_name) \ |
| 177 COMPILE_ASSERT( \ | 177 COMPILE_ASSERT( \ |
| 178 static_cast<int>(webkit_glue_name) == static_cast<int>(webkit_name), \ | 178 static_cast<int>(content_name) == static_cast<int>(webkit_name), \ |
| 179 mismatching_enums) | 179 mismatching_enums) |
| 180 | 180 |
| 181 COMPILE_ASSERT_MATCHING_ENUMS( | 181 COMPILE_ASSERT_MATCHING_ENUMS( |
| 182 webkit_glue::EDITING_BEHAVIOR_MAC, WebSettings::EditingBehaviorMac); | 182 content::EDITING_BEHAVIOR_MAC, WebSettings::EditingBehaviorMac); |
| 183 COMPILE_ASSERT_MATCHING_ENUMS( | 183 COMPILE_ASSERT_MATCHING_ENUMS( |
| 184 webkit_glue::EDITING_BEHAVIOR_WIN, WebSettings::EditingBehaviorWin); | 184 content::EDITING_BEHAVIOR_WIN, WebSettings::EditingBehaviorWin); |
| 185 COMPILE_ASSERT_MATCHING_ENUMS( | 185 COMPILE_ASSERT_MATCHING_ENUMS( |
| 186 webkit_glue::EDITING_BEHAVIOR_UNIX, WebSettings::EditingBehaviorUnix); | 186 content::EDITING_BEHAVIOR_UNIX, WebSettings::EditingBehaviorUnix); |
| 187 COMPILE_ASSERT_MATCHING_ENUMS( | 187 COMPILE_ASSERT_MATCHING_ENUMS( |
| 188 webkit_glue::EDITING_BEHAVIOR_ANDROID, WebSettings::EditingBehaviorAndroid); | 188 content::EDITING_BEHAVIOR_ANDROID, WebSettings::EditingBehaviorAndroid); |
| 189 | 189 |
| 190 } // namespace webkit_glue | 190 } // namespace content |
| OLD | NEW |