Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: webkit/glue/webpreferences.h

Issue 7606028: Pass per-script fonts to WebKit settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 // A struct for managing webkit's settings. 5 // A struct for managing webkit's settings.
6 // 6 //
7 // Adding new values to this class probably involves updating 7 // Adding new values to this class probably involves updating
8 // WebKit::WebSettings, common/render_messages.cc, browser/tab_contents/ 8 // WebKit::WebSettings, common/render_messages.cc, browser/tab_contents/
9 // render_view_host_delegate_helper.cc, and browser/profiles/profile.cc. 9 // render_view_host_delegate_helper.cc, and browser/profiles/profile.cc.
10 10
11 #ifndef WEBKIT_GLUE_WEBPREFERENCES_H__ 11 #ifndef WEBKIT_GLUE_WEBPREFERENCES_H__
12 #define WEBKIT_GLUE_WEBPREFERENCES_H__ 12 #define WEBKIT_GLUE_WEBPREFERENCES_H__
13 13
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/string16.h" 17 #include "base/string16.h"
18 #include "googleurl/src/gurl.h" 18 #include "googleurl/src/gurl.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h"
19 20
20 namespace WebKit { 21 namespace WebKit {
21 class WebView; 22 class WebView;
22 } 23 }
23 24
24 struct WebPreferences { 25 struct WebPreferences {
25 string16 standard_font_family; 26 string16 standard_font_family;
26 string16 fixed_font_family; 27 string16 fixed_font_family;
27 string16 serif_font_family; 28 string16 serif_font_family;
28 string16 sans_serif_font_family; 29 string16 sans_serif_font_family;
29 string16 cursive_font_family; 30 string16 cursive_font_family;
30 string16 fantasy_font_family; 31 string16 fantasy_font_family;
32 typedef std::vector<std::pair<std::string, string16> > ScriptFontFamilyMap;
Mattias Nissler (ping if slow) 2011/08/12 09:24:13 style guide says type declarations should go first
33 ScriptFontFamilyMap standard_font_family_map;
34 ScriptFontFamilyMap fixed_font_family_map;
35 ScriptFontFamilyMap serif_font_family_map;
36 ScriptFontFamilyMap sans_serif_font_family_map;
37 ScriptFontFamilyMap cursive_font_family_map;
38 ScriptFontFamilyMap fantasy_font_family_map;
31 int default_font_size; 39 int default_font_size;
32 int default_fixed_font_size; 40 int default_fixed_font_size;
33 int minimum_font_size; 41 int minimum_font_size;
34 int minimum_logical_font_size; 42 int minimum_logical_font_size;
35 std::string default_encoding; 43 std::string default_encoding;
36 bool javascript_enabled; 44 bool javascript_enabled;
37 bool web_security_enabled; 45 bool web_security_enabled;
38 bool javascript_can_open_windows_automatically; 46 bool javascript_can_open_windows_automatically;
39 bool loads_images_automatically; 47 bool loads_images_automatically;
40 bool plugins_enabled; 48 bool plugins_enabled;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 bool should_print_backgrounds; 102 bool should_print_backgrounds;
95 bool enable_scroll_animator; 103 bool enable_scroll_animator;
96 bool hixie76_websocket_protocol_enabled; 104 bool hixie76_websocket_protocol_enabled;
97 // We try to keep the default values the same as the default values in 105 // We try to keep the default values the same as the default values in
98 // chrome, except for the cases where it would require lots of extra work for 106 // chrome, except for the cases where it would require lots of extra work for
99 // the embedder to use the same default value. 107 // the embedder to use the same default value.
100 WebPreferences(); 108 WebPreferences();
101 ~WebPreferences(); 109 ~WebPreferences();
102 110
103 void Apply(WebKit::WebView* web_view) const; 111 void Apply(WebKit::WebView* web_view) const;
112 typedef void (*SetFontFamilyWrapper)(
Mattias Nissler (ping if slow) 2011/08/12 09:24:13 same here
113 WebKit::WebSettings*, const string16&, UScriptCode);
114 void ApplyFontsFromMap(const ScriptFontFamilyMap& map,
115 SetFontFamilyWrapper setter,
116 WebKit::WebSettings* settings) const;
104 }; 117 };
105 118
106 #endif // WEBKIT_GLUE_WEBPREFERENCES_H__ 119 #endif // WEBKIT_GLUE_WEBPREFERENCES_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698