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

Side by Side Diff: android_webview/native/aw_contents.cc

Issue 1172093002: Implement HttpUserAgentSettings delegate for Android WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New plumbing Created 5 years, 5 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "android_webview/native/aw_contents.h" 5 #include "android_webview/native/aw_contents.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "android_webview/browser/aw_browser_context.h" 9 #include "android_webview/browser/aw_browser_context.h"
10 #include "android_webview/browser/aw_browser_main_parts.h" 10 #include "android_webview/browser/aw_browser_main_parts.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const content::RenderViewHost* rvh = 150 const content::RenderViewHost* rvh =
151 content::RenderViewHost::FromID(render_process_id, render_view_id); 151 content::RenderViewHost::FromID(render_process_id, render_view_id);
152 if (!rvh) return NULL; 152 if (!rvh) return NULL;
153 content::WebContents* web_contents = 153 content::WebContents* web_contents =
154 content::WebContents::FromRenderViewHost(rvh); 154 content::WebContents::FromRenderViewHost(rvh);
155 if (!web_contents) return NULL; 155 if (!web_contents) return NULL;
156 return FromWebContents(web_contents); 156 return FromWebContents(web_contents);
157 } 157 }
158 158
159 // static 159 // static
160 std::string AwContents::GetLocale() {
161 JNIEnv* env = base::android::AttachCurrentThread();
162 return ConvertJavaStringToUTF8(Java_AwContents_getLocale(env));
163 }
164
165 // static
160 AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID( 166 AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID(
161 int render_process_id, int render_frame_id) { 167 int render_process_id, int render_frame_id) {
162 AwContents* aw_contents = AwContents::FromWebContents( 168 AwContents* aw_contents = AwContents::FromWebContents(
163 content::WebContents::FromRenderFrameHost( 169 content::WebContents::FromRenderFrameHost(
164 content::RenderFrameHost::FromID(render_process_id, 170 content::RenderFrameHost::FromID(render_process_id,
165 render_frame_id))); 171 render_frame_id)));
166 return implicit_cast<AwBrowserPermissionRequestDelegate*>(aw_contents); 172 return implicit_cast<AwBrowserPermissionRequestDelegate*>(aw_contents);
167 } 173 }
168 174
169 AwContents::AwContents(scoped_ptr<WebContents> web_contents) 175 AwContents::AwContents(scoped_ptr<WebContents> web_contents)
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 1182
1177 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, 1183 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports,
1178 GetMessagePortMessageFilter()); 1184 GetMessagePortMessageFilter());
1179 } 1185 }
1180 1186
1181 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1187 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1182 g_should_download_favicons = true; 1188 g_should_download_favicons = true;
1183 } 1189 }
1184 1190
1185 } // namespace android_webview 1191 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698