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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 java_script_enabled = | 67 java_script_enabled = |
68 GetFieldID(env, clazz, "mJavaScriptEnabled", "Z"); | 68 GetFieldID(env, clazz, "mJavaScriptEnabled", "Z"); |
69 allow_universal_access_from_file_urls = | 69 allow_universal_access_from_file_urls = |
70 GetFieldID(env, clazz, "mAllowUniversalAccessFromFileURLs", "Z"); | 70 GetFieldID(env, clazz, "mAllowUniversalAccessFromFileURLs", "Z"); |
71 allow_file_access_from_file_urls = | 71 allow_file_access_from_file_urls = |
72 GetFieldID(env, clazz, "mAllowFileAccessFromFileURLs", "Z"); | 72 GetFieldID(env, clazz, "mAllowFileAccessFromFileURLs", "Z"); |
73 java_script_can_open_windows_automatically = | 73 java_script_can_open_windows_automatically = |
74 GetFieldID(env, clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); | 74 GetFieldID(env, clazz, "mJavaScriptCanOpenWindowsAutomatically", "Z"); |
75 dom_storage_enabled = | 75 dom_storage_enabled = |
76 GetFieldID(env, clazz, "mDomStorageEnabled", "Z"); | 76 GetFieldID(env, clazz, "mDomStorageEnabled", "Z"); |
77 allow_file_access = | |
78 GetFieldID(env, clazz, "mAllowFileAccess", "Z"); | |
79 allow_content_access = | |
80 GetFieldID(env, clazz, "mAllowContentAccess", "Z"); | |
Satish
2012/08/20 10:16:57
Is this for 'content uri' access? If so, could the
mnaganov (inactive)
2012/08/20 13:32:55
Done.
| |
77 } | 81 } |
78 | 82 |
79 // Field ids | 83 // Field ids |
80 jfieldID standard_fond_family; | 84 jfieldID standard_fond_family; |
81 jfieldID fixed_font_family; | 85 jfieldID fixed_font_family; |
82 jfieldID sans_serif_font_family; | 86 jfieldID sans_serif_font_family; |
83 jfieldID serif_font_family; | 87 jfieldID serif_font_family; |
84 jfieldID cursive_font_family; | 88 jfieldID cursive_font_family; |
85 jfieldID fantasy_font_family; | 89 jfieldID fantasy_font_family; |
86 jfieldID default_text_encoding; | 90 jfieldID default_text_encoding; |
87 jfieldID user_agent; | 91 jfieldID user_agent; |
88 jfieldID minimum_font_size; | 92 jfieldID minimum_font_size; |
89 jfieldID minimum_logical_font_size; | 93 jfieldID minimum_logical_font_size; |
90 jfieldID default_font_size; | 94 jfieldID default_font_size; |
91 jfieldID default_fixed_font_size; | 95 jfieldID default_fixed_font_size; |
92 jfieldID load_images_automatically; | 96 jfieldID load_images_automatically; |
93 jfieldID java_script_enabled; | 97 jfieldID java_script_enabled; |
94 jfieldID allow_universal_access_from_file_urls; | 98 jfieldID allow_universal_access_from_file_urls; |
95 jfieldID allow_file_access_from_file_urls; | 99 jfieldID allow_file_access_from_file_urls; |
96 jfieldID java_script_can_open_windows_automatically; | 100 jfieldID java_script_can_open_windows_automatically; |
97 jfieldID dom_storage_enabled; | 101 jfieldID dom_storage_enabled; |
102 jfieldID allow_file_access; | |
103 jfieldID allow_content_access; | |
98 }; | 104 }; |
99 | 105 |
100 ContentSettings::ContentSettings(JNIEnv* env, | 106 ContentSettings::ContentSettings(JNIEnv* env, |
101 jobject obj, | 107 jobject obj, |
102 WebContents* contents, | 108 WebContents* contents, |
103 bool is_master_mode) | 109 bool is_master_mode) |
104 : WebContentsObserver(contents), | 110 : WebContentsObserver(contents), |
105 is_master_mode_(is_master_mode) { | 111 is_master_mode_(is_master_mode) { |
106 content_settings_.Reset(env, obj); | 112 content_settings_.Reset(env, obj); |
107 } | 113 } |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
330 return reinterpret_cast<jint>(content_settings); | 336 return reinterpret_cast<jint>(content_settings); |
331 } | 337 } |
332 | 338 |
333 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 339 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
334 // "Version/4.0" had been hardcoded in the legacy WebView. | 340 // "Version/4.0" had been hardcoded in the legacy WebView. |
335 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); | 341 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); |
336 return base::android::ConvertUTF8ToJavaString(env, ua).Release(); | 342 return base::android::ConvertUTF8ToJavaString(env, ua).Release(); |
337 } | 343 } |
338 | 344 |
339 } // namespace content | 345 } // namespace content |
OLD | NEW |