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

Side by Side Diff: content/browser/android/content_settings.cc

Issue 10908285: Add WebContents accessor in ContentViewCore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 3 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.h » ('j') | content/public/browser/android/content_view_core.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698