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

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

Issue 1158813002: Use RenderFrameHost for ::RequestPermission() and ::CancelPermission(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID( 160 AwBrowserPermissionRequestDelegate* AwBrowserPermissionRequestDelegate::FromID(
161 int render_process_id, int render_view_id) { 161 int render_process_id, int render_frame_id) {
162 AwContents* aw_contents = AwContents::FromID(render_process_id, 162 AwContents* aw_contents = AwContents::FromWebContents(
163 render_view_id); 163 content::WebContents::FromRenderFrameHost(
164 content::RenderFrameHost::FromID(render_process_id,
165 render_frame_id)));
164 return implicit_cast<AwBrowserPermissionRequestDelegate*>(aw_contents); 166 return implicit_cast<AwBrowserPermissionRequestDelegate*>(aw_contents);
165 } 167 }
166 168
167 AwContents::AwContents(scoped_ptr<WebContents> web_contents) 169 AwContents::AwContents(scoped_ptr<WebContents> web_contents)
168 : web_contents_(web_contents.Pass()), 170 : web_contents_(web_contents.Pass()),
169 browser_view_renderer_( 171 browser_view_renderer_(
170 this, 172 this,
171 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)), 173 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)),
172 renderer_manager_key_(GLViewRendererManager::GetInstance()->NullKey()) { 174 renderer_manager_key_(GLViewRendererManager::GetInstance()->NullKey()) {
173 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, 1); 175 base::subtle::NoBarrier_AtomicIncrement(&g_instance_count, 1);
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 1165
1164 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports, 1166 AwMessagePortServiceImpl::GetInstance()->CreateMessageChannel(env, ports,
1165 GetMessagePortMessageFilter()); 1167 GetMessagePortMessageFilter());
1166 } 1168 }
1167 1169
1168 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { 1170 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) {
1169 g_should_download_favicons = true; 1171 g_should_download_favicons = true;
1170 } 1172 }
1171 1173
1172 } // namespace android_webview 1174 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698