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 "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_browser_main_parts.h" | 8 #include "android_webview/browser/aw_browser_main_parts.h" |
9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" | 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
10 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 10 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 int render_process_id, | 142 int render_process_id, |
143 int render_view_id, | 143 int render_view_id, |
144 const GURL& origin) { | 144 const GURL& origin) { |
145 AwBrowserPermissionRequestDelegate* delegate = | 145 AwBrowserPermissionRequestDelegate* delegate = |
146 AwBrowserPermissionRequestDelegate::FromID(render_process_id, | 146 AwBrowserPermissionRequestDelegate::FromID(render_process_id, |
147 render_view_id); | 147 render_view_id); |
148 if (delegate) | 148 if (delegate) |
149 delegate->CancelProtectedMediaIdentifierPermissionRequests(origin); | 149 delegate->CancelProtectedMediaIdentifierPermissionRequests(origin); |
150 } | 150 } |
151 | 151 |
152 void CancelGeolocationPermissionRequests( | 152 void CancelGeolocationPermissionRequests( |
Michael van Ouwerkerk
2014/08/13 10:01:10
Looks like this is dead code now. No callers in fi
Miguel Garcia
2014/08/13 13:18:12
Done.
| |
153 int render_process_id, | 153 int render_process_id, |
154 int render_view_id, | 154 int render_view_id, |
155 const GURL& origin) { | 155 const GURL& origin) { |
156 AwBrowserPermissionRequestDelegate* delegate = | 156 AwBrowserPermissionRequestDelegate* delegate = |
157 AwBrowserPermissionRequestDelegate::FromID(render_process_id, | 157 AwBrowserPermissionRequestDelegate::FromID(render_process_id, |
158 render_view_id); | 158 render_view_id); |
159 if (delegate) | 159 if (delegate) |
160 delegate->CancelGeolocationPermissionRequests(origin); | 160 delegate->CancelGeolocationPermissionRequests(origin); |
161 } | 161 } |
162 | 162 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 scoped_ptr<content::DesktopNotificationDelegate> delegate, | 409 scoped_ptr<content::DesktopNotificationDelegate> delegate, |
410 base::Closure* cancel_callback) { | 410 base::Closure* cancel_callback) { |
411 NOTREACHED() << "Android WebView does not support desktop notifications."; | 411 NOTREACHED() << "Android WebView does not support desktop notifications."; |
412 } | 412 } |
413 | 413 |
414 void AwContentBrowserClient::RequestGeolocationPermission( | 414 void AwContentBrowserClient::RequestGeolocationPermission( |
415 content::WebContents* web_contents, | 415 content::WebContents* web_contents, |
416 int bridge_id, | 416 int bridge_id, |
417 const GURL& requesting_frame, | 417 const GURL& requesting_frame, |
418 bool user_gesture, | 418 bool user_gesture, |
419 base::Callback<void(bool)> result_callback, | 419 const base::Callback<void(bool)> result_callback) { |
420 base::Closure* cancel_callback) { | |
421 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); | 420 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); |
422 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); | 421 int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); |
423 AwBrowserPermissionRequestDelegate* delegate = | 422 AwBrowserPermissionRequestDelegate* delegate = |
424 AwBrowserPermissionRequestDelegate::FromID(render_process_id, | 423 AwBrowserPermissionRequestDelegate::FromID(render_process_id, |
425 render_view_id); | 424 render_view_id); |
426 if (delegate == NULL) { | 425 if (delegate == NULL) { |
427 DVLOG(0) << "Dropping GeolocationPermission request"; | 426 DVLOG(0) << "Dropping GeolocationPermission request"; |
428 result_callback.Run(false); | 427 result_callback.Run(false); |
429 return; | 428 return; |
430 } | 429 } |
431 | 430 |
432 GURL origin = requesting_frame.GetOrigin(); | 431 GURL origin = requesting_frame.GetOrigin(); |
433 if (cancel_callback) { | |
434 *cancel_callback = base::Bind( | |
435 CancelGeolocationPermissionRequests, render_process_id, render_view_id, | |
436 origin); | |
437 } | |
438 delegate->RequestGeolocationPermission(origin, result_callback); | 432 delegate->RequestGeolocationPermission(origin, result_callback); |
439 } | 433 } |
440 | 434 |
441 void AwContentBrowserClient::RequestMidiSysExPermission( | 435 void AwContentBrowserClient::RequestMidiSysExPermission( |
442 content::WebContents* web_contents, | 436 content::WebContents* web_contents, |
443 int bridge_id, | 437 int bridge_id, |
444 const GURL& requesting_frame, | 438 const GURL& requesting_frame, |
445 bool user_gesture, | 439 bool user_gesture, |
446 base::Callback<void(bool)> result_callback, | 440 base::Callback<void(bool)> result_callback, |
447 base::Closure* cancel_callback) { | 441 base::Closure* cancel_callback) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
588 | 582 |
589 #if defined(VIDEO_HOLE) | 583 #if defined(VIDEO_HOLE) |
590 content::ExternalVideoSurfaceContainer* | 584 content::ExternalVideoSurfaceContainer* |
591 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 585 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
592 content::WebContents* web_contents) { | 586 content::WebContents* web_contents) { |
593 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 587 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
594 } | 588 } |
595 #endif | 589 #endif |
596 | 590 |
597 } // namespace android_webview | 591 } // namespace android_webview |
OLD | NEW |