OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "content/browser/android/content_settings.h" | 5 #include "content/browser/android/content_settings.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "content/browser/android/content_view_core_impl.h" | 9 #include "content/browser/android/content_view_core_impl.h" |
10 #include "content/browser/renderer_host/render_view_host_delegate.h" | 10 #include "content/browser/renderer_host/render_view_host_delegate.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 java_script_enabled = | 70 java_script_enabled = |
71 GetFieldID(env, clazz, "mJavaScriptEnabled", "Z"); | 71 GetFieldID(env, clazz, "mJavaScriptEnabled", "Z"); |
72 allow_universal_access_from_file_urls = | 72 allow_universal_access_from_file_urls = |
73 GetFieldID(env, clazz, "mAllowUniversalAccessFromFileURLs", "Z"); | 73 GetFieldID(env, clazz, "mAllowUniversalAccessFromFileURLs", "Z"); |
74 allow_file_access_from_file_urls = | 74 allow_file_access_from_file_urls = |
75 GetFieldID(env, clazz, "mAllowFileAccessFromFileURLs", "Z"); | 75 GetFieldID(env, clazz, "mAllowFileAccessFromFileURLs", "Z"); |
76 java_script_can_open_windows_automatically = | 76 java_script_can_open_windows_automatically = |
77 GetFieldID(env, clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); | 77 GetFieldID(env, clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); |
78 dom_storage_enabled = | 78 dom_storage_enabled = |
79 GetFieldID(env, clazz, "mDomStorageEnabled", "Z"); | 79 GetFieldID(env, clazz, "mDomStorageEnabled", "Z"); |
80 allow_file_url_access = | |
81 GetFieldID(env, clazz, "mAllowFileUrlAccess", "Z"); | |
82 allow_content_url_access = | |
83 GetFieldID(env, clazz, "mAllowContentUrlAccess", "Z"); | |
84 } | 80 } |
85 | 81 |
86 // Field ids | 82 // Field ids |
87 jfieldID standard_fond_family; | 83 jfieldID standard_fond_family; |
88 jfieldID fixed_font_family; | 84 jfieldID fixed_font_family; |
89 jfieldID sans_serif_font_family; | 85 jfieldID sans_serif_font_family; |
90 jfieldID serif_font_family; | 86 jfieldID serif_font_family; |
91 jfieldID cursive_font_family; | 87 jfieldID cursive_font_family; |
92 jfieldID fantasy_font_family; | 88 jfieldID fantasy_font_family; |
93 jfieldID default_text_encoding; | 89 jfieldID default_text_encoding; |
94 jfieldID user_agent; | 90 jfieldID user_agent; |
95 jfieldID minimum_font_size; | 91 jfieldID minimum_font_size; |
96 jfieldID minimum_logical_font_size; | 92 jfieldID minimum_logical_font_size; |
97 jfieldID default_font_size; | 93 jfieldID default_font_size; |
98 jfieldID default_fixed_font_size; | 94 jfieldID default_fixed_font_size; |
99 jfieldID load_images_automatically; | 95 jfieldID load_images_automatically; |
100 jfieldID images_enabled; | 96 jfieldID images_enabled; |
101 jfieldID java_script_enabled; | 97 jfieldID java_script_enabled; |
102 jfieldID allow_universal_access_from_file_urls; | 98 jfieldID allow_universal_access_from_file_urls; |
103 jfieldID allow_file_access_from_file_urls; | 99 jfieldID allow_file_access_from_file_urls; |
104 jfieldID java_script_can_open_windows_automatically; | 100 jfieldID java_script_can_open_windows_automatically; |
105 jfieldID dom_storage_enabled; | 101 jfieldID dom_storage_enabled; |
106 jfieldID allow_file_url_access; | |
107 jfieldID allow_content_url_access; | |
108 }; | 102 }; |
109 | 103 |
110 ContentSettings::ContentSettings(JNIEnv* env, | 104 ContentSettings::ContentSettings(JNIEnv* env, |
111 jobject obj, | 105 jobject obj, |
112 WebContents* contents, | 106 WebContents* contents, |
113 bool is_master_mode) | 107 bool is_master_mode) |
114 : WebContentsObserver(contents), | 108 : WebContentsObserver(contents), |
115 is_master_mode_(is_master_mode) { | 109 is_master_mode_(is_master_mode) { |
116 content_settings_.Reset(env, obj); | 110 content_settings_.Reset(env, obj); |
117 } | 111 } |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 return reinterpret_cast<jint>(content_settings); | 342 return reinterpret_cast<jint>(content_settings); |
349 } | 343 } |
350 | 344 |
351 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 345 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
352 // "Version/4.0" had been hardcoded in the legacy WebView. | 346 // "Version/4.0" had been hardcoded in the legacy WebView. |
353 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); | 347 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); |
354 return base::android::ConvertUTF8ToJavaString(env, ua).Release(); | 348 return base::android::ConvertUTF8ToJavaString(env, ua).Release(); |
355 } | 349 } |
356 | 350 |
357 } // namespace content | 351 } // namespace content |
OLD | NEW |