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

Side by Side Diff: android_webview/native/aw_settings.cc

Issue 413003002: Add FontRenderParamsQuery. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update PlatformFontWin::GetFontRenderParams() to use a static Created 6 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/renderer_preferences_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "android_webview/native/aw_settings.h" 5 #include "android_webview/native/aw_settings.h"
6 6
7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" 7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h"
8 #include "android_webview/common/aw_content_client.h" 8 #include "android_webview/common/aw_content_client.h"
9 #include "android_webview/native/aw_contents.h" 9 #include "android_webview/native/aw_contents.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "base/macros.h"
12 #include "base/supports_user_data.h" 13 #include "base/supports_user_data.h"
13 #include "content/public/browser/navigation_controller.h" 14 #include "content/public/browser/navigation_controller.h"
14 #include "content/public/browser/navigation_entry.h" 15 #include "content/public/browser/navigation_entry.h"
15 #include "content/public/browser/render_view_host.h" 16 #include "content/public/browser/render_view_host.h"
16 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
17 #include "content/public/common/renderer_preferences.h" 18 #include "content/public/common/renderer_preferences.h"
18 #include "content/public/common/web_preferences.h" 19 #include "content/public/common/web_preferences.h"
19 #include "jni/AwSettings_jni.h" 20 #include "jni/AwSettings_jni.h"
20 #include "ui/gfx/font_render_params.h" 21 #include "ui/gfx/font_render_params.h"
21 22
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 << subpixel_rendering; 68 << subpixel_rendering;
68 return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT; 69 return content::RENDERER_PREFERENCES_SUBPIXEL_RENDERING_SYSTEM_DEFAULT;
69 } 70 }
70 } 71 }
71 72
72 void PopulateFixedRendererPreferences(RendererPreferences* prefs) { 73 void PopulateFixedRendererPreferences(RendererPreferences* prefs) {
73 prefs->tap_multiple_targets_strategy = 74 prefs->tap_multiple_targets_strategy =
74 content::TAP_MULTIPLE_TARGETS_STRATEGY_NONE; 75 content::TAP_MULTIPLE_TARGETS_STRATEGY_NONE;
75 76
76 // TODO(boliu): Deduplicate with chrome/ code. 77 // TODO(boliu): Deduplicate with chrome/ code.
77 const gfx::FontRenderParams& params = gfx::GetDefaultWebKitFontRenderParams(); 78 CR_DEFINE_STATIC_LOCAL(const gfx::FontRenderParams, params,
79 (gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(true), NULL)));
78 prefs->should_antialias_text = params.antialiasing; 80 prefs->should_antialias_text = params.antialiasing;
79 prefs->use_subpixel_positioning = params.subpixel_positioning; 81 prefs->use_subpixel_positioning = params.subpixel_positioning;
80 prefs->hinting = GetRendererPreferencesHintingEnum(params.hinting); 82 prefs->hinting = GetRendererPreferencesHintingEnum(params.hinting);
81 prefs->use_autohinter = params.autohinter; 83 prefs->use_autohinter = params.autohinter;
82 prefs->use_bitmaps = params.use_bitmaps; 84 prefs->use_bitmaps = params.use_bitmaps;
83 prefs->subpixel_rendering = 85 prefs->subpixel_rendering =
84 GetRendererPreferencesSubpixelRenderingEnum(params.subpixel_rendering); 86 GetRendererPreferencesSubpixelRenderingEnum(params.subpixel_rendering);
85 } 87 }
86 88
87 void PopulateFixedWebPreferences(WebPreferences* web_prefs) { 89 void PopulateFixedWebPreferences(WebPreferences* web_prefs) {
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 446
445 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { 447 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) {
446 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); 448 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release();
447 } 449 }
448 450
449 bool RegisterAwSettings(JNIEnv* env) { 451 bool RegisterAwSettings(JNIEnv* env) {
450 return RegisterNativesImpl(env); 452 return RegisterNativesImpl(env);
451 } 453 }
452 454
453 } // namespace android_webview 455 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_preferences_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698