1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 5 // A struct for managing webkit's settings. 6 // 7 // Adding new values to this class probably involves updating 8 // WebKit::WebSettings, common/render_messages.cc, browser/tab_contents/ 9 // render_view_host_delegate_helper.cc, and browser/profiles/profile.cc. 10 11 #ifndef WEBKIT_GLUE_WEBPREFERENCES_H__ 12 #define WEBKIT_GLUE_WEBPREFERENCES_H__ 13 14 #include <string> 15 #include <vector> 16 17 #include "base/string16.h" 18 #include "googleurl/src/gurl.h" 19 20 namespace WebKit { 21 class WebView; 22 } 23 24 struct WebPreferences { 25 string16 standard_font_family; 26 string16 fixed_font_family; 27 string16 serif_font_family; 28 string16 sans_serif_font_family; 29 string16 cursive_font_family; 30 string16 fantasy_font_family; 31 int default_font_size; 32 int default_fixed_font_size; 33 int minimum_font_size; 34 int minimum_logical_font_size; 35 std::string default_encoding; 36 bool javascript_enabled; 37 bool web_security_enabled; 38 bool javascript_can_open_windows_automatically; 39 bool loads_images_automatically; 40 bool plugins_enabled; 41 bool dom_paste_enabled; 42 bool developer_extras_enabled; 43 typedef std::vector<std::pair<std::string, std::string> > 44 WebInspectorPreferences; 45 WebInspectorPreferences inspector_settings; 46 bool site_specific_quirks_enabled; 47 bool shrinks_standalone_images_to_fit; 48 bool uses_universal_detector; 49 bool text_areas_are_resizable; 50 bool java_enabled; 51 bool allow_scripts_to_close_windows; 52 bool uses_page_cache; 53 bool remote_fonts_enabled; 54 bool javascript_can_access_clipboard; 55 bool xss_auditor_enabled; 56 bool local_storage_enabled; 57 bool databases_enabled; 58 bool application_cache_enabled; 59 bool tabs_to_links; 60 bool caret_browsing_enabled; 61 bool hyperlink_auditing_enabled; 62 63 bool user_style_sheet_enabled; 64 GURL user_style_sheet_location; 65 bool author_and_user_styles_enabled; 66 bool frame_flattening_enabled; 67 bool allow_universal_access_from_file_urls; 68 bool allow_file_access_from_file_urls; 69 bool webaudio_enabled; 70 bool experimental_webgl_enabled; 71 bool gl_multisampling_enabled; 72 bool show_composited_layer_borders; 73 bool show_composited_layer_tree; 74 bool show_fps_counter; 75 bool asynchronous_spell_checking_enabled; 76 bool accelerated_compositing_enabled; 77 bool force_compositing_mode; 78 bool composite_to_texture_enabled; 79 bool accelerated_layers_enabled; 80 bool accelerated_video_enabled; 81 bool accelerated_2d_canvas_enabled; 82 bool accelerated_drawing_enabled; 83 bool accelerated_plugins_enabled; 84 bool memory_info_enabled; 85 bool interactive_form_validation_enabled; 86 bool fullscreen_enabled; 87 88 // We try to keep the default values the same as the default values in 89 // chrome, except for the cases where it would require lots of extra work for 90 // the embedder to use the same default value. 91 WebPreferences(); 92 ~WebPreferences(); 93 94 void Apply(WebKit::WebView* web_view) const; 95 }; 96 97 #endif // WEBKIT_GLUE_WEBPREFERENCES_H__ 98