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

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

Issue 11017024: Implement AwContentsClient and remove dependency on chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Also slip in removing 'aw_' from aw_contents_client_ var name Created 8 years, 2 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
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "content/browser/renderer_host/render_view_host_impl.h" 11 #include "content/browser/renderer_host/render_view_host_impl.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/content_client.h"
13 #include "jni/ContentSettings_jni.h" 14 #include "jni/ContentSettings_jni.h"
14 #include "webkit/glue/webkit_glue.h" 15 #include "webkit/glue/webkit_glue.h"
15 #include "webkit/glue/webpreferences.h" 16 #include "webkit/glue/webpreferences.h"
16 #include "webkit/user_agent/user_agent.h" 17 #include "webkit/user_agent/user_agent.h"
17 #include "webkit/user_agent/user_agent_util.h"
18 18
19 using base::android::CheckException; 19 using base::android::CheckException;
20 using base::android::ConvertJavaStringToUTF16; 20 using base::android::ConvertJavaStringToUTF16;
21 using base::android::ConvertUTF16ToJavaString; 21 using base::android::ConvertUTF16ToJavaString;
22 using base::android::ConvertUTF8ToJavaString; 22 using base::android::ConvertUTF8ToJavaString;
23 using base::android::GetClass; 23 using base::android::GetClass;
24 using base::android::GetFieldID; 24 using base::android::GetFieldID;
25 using base::android::GetMethodIDFromClassName; 25 using base::android::GetMethodIDFromClassName;
26 using base::android::ScopedJavaLocalRef; 26 using base::android::ScopedJavaLocalRef;
27 using webkit_glue::WebPreferences; 27 using webkit_glue::WebPreferences;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 jboolean is_master_mode) { 342 jboolean is_master_mode) {
343 WebContents* web_contents = 343 WebContents* web_contents =
344 reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore) 344 reinterpret_cast<ContentViewCoreImpl*>(nativeContentViewCore)
345 ->GetWebContents(); 345 ->GetWebContents();
346 ContentSettings* content_settings = 346 ContentSettings* content_settings =
347 new ContentSettings(env, obj, web_contents, is_master_mode); 347 new ContentSettings(env, obj, web_contents, is_master_mode);
348 return reinterpret_cast<jint>(content_settings); 348 return reinterpret_cast<jint>(content_settings);
349 } 349 }
350 350
351 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { 351 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) {
352 // "Version/4.0" had been hardcoded in the legacy WebView. 352 return base::android::ConvertUTF8ToJavaString(
353 std::string ua = webkit_glue::BuildUserAgentFromProduct("Version/4.0"); 353 env, GetContentClient()->GetUserAgent()).Release();
354 return base::android::ConvertUTF8ToJavaString(env, ua).Release();
355 } 354 }
356 355
357 } // namespace content 356 } // namespace content
OLDNEW
« no previous file with comments | « android_webview/lib/main/aw_main_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698