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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 void ContentSettings::RenderViewCreated(RenderViewHost* render_view_host) { | 325 void ContentSettings::RenderViewCreated(RenderViewHost* render_view_host) { |
326 if (is_master_mode_) | 326 if (is_master_mode_) |
327 SyncToNativeImpl(); | 327 SyncToNativeImpl(); |
328 } | 328 } |
329 | 329 |
330 static jint Init(JNIEnv* env, jobject obj, jint nativeContentViewCore, | 330 static jint Init(JNIEnv* env, jobject obj, jint nativeContentViewCore, |
331 jboolean is_master_mode) { | 331 jboolean is_master_mode) { |
332 WebContents* web_contents = | 332 WebContents* web_contents = |
333 reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore) | 333 reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore) |
334 ->web_contents(); | 334 ->GetWebContents(); |
335 ContentSettings* content_settings = | 335 ContentSettings* content_settings = |
336 new ContentSettings(env, obj, web_contents, is_master_mode); | 336 new ContentSettings(env, obj, web_contents, is_master_mode); |
337 return reinterpret_cast<jint>(content_settings); | 337 return reinterpret_cast<jint>(content_settings); |
338 } | 338 } |
339 | 339 |
340 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 340 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
341 // "Version/4.0" had been hardcoded in the legacy WebView. | 341 // "Version/4.0" had been hardcoded in the legacy WebView. |
342 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); | 342 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); |
343 return base::android::ConvertUTF8ToJavaString(env, ua).Release(); | 343 return base::android::ConvertUTF8ToJavaString(env, ua).Release(); |
344 } | 344 } |
345 | 345 |
346 } // namespace content | 346 } // namespace content |
OLD | NEW |