| OLD | NEW |
| 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" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 prefs->use_autohinter = params.autohinter; | 43 prefs->use_autohinter = params.autohinter; |
| 44 prefs->use_bitmaps = params.use_bitmaps; | 44 prefs->use_bitmaps = params.use_bitmaps; |
| 45 prefs->subpixel_rendering = params.subpixel_rendering; | 45 prefs->subpixel_rendering = params.subpixel_rendering; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void PopulateFixedWebPreferences(WebPreferences* web_prefs) { | 48 void PopulateFixedWebPreferences(WebPreferences* web_prefs) { |
| 49 web_prefs->shrinks_standalone_images_to_fit = false; | 49 web_prefs->shrinks_standalone_images_to_fit = false; |
| 50 web_prefs->should_clear_document_background = false; | 50 web_prefs->should_clear_document_background = false; |
| 51 } | 51 } |
| 52 | 52 |
| 53 const void* const kAwSettingsUserDataKey = &kAwSettingsUserDataKey; |
| 54 |
| 53 }; // namespace | 55 }; // namespace |
| 54 | 56 |
| 55 const void* kAwSettingsUserDataKey = &kAwSettingsUserDataKey; | |
| 56 | |
| 57 class AwSettingsUserData : public base::SupportsUserData::Data { | 57 class AwSettingsUserData : public base::SupportsUserData::Data { |
| 58 public: | 58 public: |
| 59 AwSettingsUserData(AwSettings* ptr) : settings_(ptr) {} | 59 explicit AwSettingsUserData(AwSettings* ptr) : settings_(ptr) {} |
| 60 | 60 |
| 61 static AwSettings* GetSettings(content::WebContents* web_contents) { | 61 static AwSettings* GetSettings(content::WebContents* web_contents) { |
| 62 if (!web_contents) | 62 if (!web_contents) |
| 63 return NULL; | 63 return NULL; |
| 64 AwSettingsUserData* data = static_cast<AwSettingsUserData*>( | 64 AwSettingsUserData* data = static_cast<AwSettingsUserData*>( |
| 65 web_contents->GetUserData(kAwSettingsUserDataKey)); | 65 web_contents->GetUserData(kAwSettingsUserDataKey)); |
| 66 return data ? data->settings_ : NULL; | 66 return data ? data->settings_ : NULL; |
| 67 } | 67 } |
| 68 | 68 |
| 69 private: | 69 private: |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 JNIEnv* env, | 435 JNIEnv* env, |
| 436 const JavaParamRef<jclass>& clazz) { | 436 const JavaParamRef<jclass>& clazz) { |
| 437 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()); | 437 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()); |
| 438 } | 438 } |
| 439 | 439 |
| 440 bool RegisterAwSettings(JNIEnv* env) { | 440 bool RegisterAwSettings(JNIEnv* env) { |
| 441 return RegisterNativesImpl(env); | 441 return RegisterNativesImpl(env); |
| 442 } | 442 } |
| 443 | 443 |
| 444 } // namespace android_webview | 444 } // namespace android_webview |
| OLD | NEW |