1 // Copyright (c) 2012 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 browser's settings that apply to the renderer or its 6 // webview. These differ from WebPreferences since they apply to Chromium's 7 // glue layer rather than applying to just WebKit. 8 // 9 // Adding new values to this class probably involves updating 10 // common/view_messages.h, browser/browser.cc, etc. 11 12 #ifndef CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_ 13 #define CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_ 14 15 #include <string> 16 #include <vector> 17 18 #include "content/common/content_export.h" 19 #include "third_party/skia/include/core/SkColor.h" 20 #include "ui/gfx/font_render_params.h" 21 22 namespace content { 23 24 enum TapMultipleTargetsStrategy { 25 TAP_MULTIPLE_TARGETS_STRATEGY_ZOOM = 0, 26 TAP_MULTIPLE_TARGETS_STRATEGY_POPUP, 27 TAP_MULTIPLE_TARGETS_STRATEGY_NONE, 28 29 TAP_MULTIPLE_TARGETS_STRATEGY_MAX = TAP_MULTIPLE_TARGETS_STRATEGY_NONE, 30 }; 31 32 struct CONTENT_EXPORT RendererPreferences { 33 RendererPreferences(); 34 ~RendererPreferences(); 35 36 // Whether the renderer's current browser context accept drops from the OS 37 // that result in navigations away from the current page. 38 bool can_accept_load_drops; 39 40 // Whether text should be antialiased. 41 // Currently only used by Linux. 42 bool should_antialias_text; 43 44 // The level of hinting to use when rendering text. 45 // Currently only used by Linux. 46 gfx::FontRenderParams::Hinting hinting; 47 48 // Whether auto hinter should be used. Currently only used by Linux. 49 bool use_autohinter; 50 51 // Whether embedded bitmap strikes in fonts should be used. 52 // Current only used by Linux. 53 bool use_bitmaps; 54 55 // The type of subpixel rendering to use for text. 56 // Currently only used by Linux. 57 gfx::FontRenderParams::SubpixelRendering subpixel_rendering; 58 59 // Whether subpixel positioning should be used, permitting fractional X 60 // positions for glyphs. Currently only used by Linux. 61 bool use_subpixel_positioning; 62 63 // The color of the focus ring. Currently only used on Linux. 64 SkColor focus_ring_color; 65 66 // The color of different parts of the scrollbar. Currently only used on 67 // Linux. 68 SkColor thumb_active_color; 69 SkColor thumb_inactive_color; 70 SkColor track_color; 71 72 // The colors used in selection text. Currently only used on Linux and Ash. 73 SkColor active_selection_bg_color; 74 SkColor active_selection_fg_color; 75 SkColor inactive_selection_bg_color; 76 SkColor inactive_selection_fg_color; 77 78 // Browser wants a look at all non-local top level navigation requests. 79 bool browser_handles_non_local_top_level_requests; 80 81 // Browser wants a look at all top-level navigation requests. 82 bool browser_handles_all_top_level_requests; 83 84 // Cursor blink rate in seconds. 85 // Currently only changed from default on Linux. Uses |gtk-cursor-blink| 86 // from GtkSettings. 87 double caret_blink_interval; 88 89 // Whether or not to set custom colors at all. 90 bool use_custom_colors; 91 92 // Set to false to not send referrers. 93 bool enable_referrers; 94 95 // Set to true to indicate that the preference to set DNT to 1 is enabled. 96 bool enable_do_not_track; 97 98 // Default page zoom level. 99 double default_zoom_level; 100 101 // The user agent given to WebKit when it requests one and the user agent is 102 // being overridden for the current navigation. 103 std::string user_agent_override; 104 105 // The accept-languages of the browser, comma-separated. 106 std::string accept_languages; 107 108 // Specifies whether the renderer reports frame name changes to the browser 109 // process. 110 // TODO(fsamuel): This is a short-term workaround to avoid regressing 111 // Sunspider. We need to find an efficient way to report changes to frame 112 // names to the browser process. See http://crbug.com/169110 for more 113 // information. 114 bool report_frame_name_changes; 115 116 // How to handle a tap gesture touching multiple targets 117 TapMultipleTargetsStrategy tap_multiple_targets_strategy; 118 119 // Disables rendering default error page when client choses to block a page. 120 // Corresponds to net::ERR_BLOCKED_BY_CLIENT. 121 bool disable_client_blocked_error_page; 122 123 // Determines whether plugins are allowed to enter fullscreen mode. 124 bool plugin_fullscreen_allowed; 125 126 // Whether video-overlay (hole-punching) should be used for the embedded 127 // encrypted video. Currently only used by Android. 128 bool use_video_overlay_for_embedded_encrypted_video; 129 }; 130 131 } // namespace content 132 133 #endif // CONTENT_PUBLIC_COMMON_RENDERER_PREFERENCES_H_ 134