OLD | NEW |
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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 permission_request_handler_->SendRequest( | 650 permission_request_handler_->SendRequest( |
651 std::unique_ptr<AwPermissionRequestDelegate>(new SimplePermissionRequest( | 651 std::unique_ptr<AwPermissionRequestDelegate>(new SimplePermissionRequest( |
652 origin, AwPermissionRequest::MIDISysex, callback))); | 652 origin, AwPermissionRequest::MIDISysex, callback))); |
653 } | 653 } |
654 | 654 |
655 void AwContents::CancelMIDISysexPermissionRequests(const GURL& origin) { | 655 void AwContents::CancelMIDISysexPermissionRequests(const GURL& origin) { |
656 permission_request_handler_->CancelRequest( | 656 permission_request_handler_->CancelRequest( |
657 origin, AwPermissionRequest::AwPermissionRequest::MIDISysex); | 657 origin, AwPermissionRequest::AwPermissionRequest::MIDISysex); |
658 } | 658 } |
659 | 659 |
| 660 void AwContents::RequestSensorPermission( |
| 661 const GURL& origin, |
| 662 const base::Callback<void(bool)>& callback) { |
| 663 permission_request_handler_->SendRequest( |
| 664 std::unique_ptr<AwPermissionRequestDelegate>(new SimplePermissionRequest( |
| 665 origin, AwPermissionRequest::Sensors, callback))); |
| 666 } |
| 667 |
| 668 void AwContents::CancelSensorPermissionRequests(const GURL& origin) { |
| 669 permission_request_handler_->CancelRequest( |
| 670 origin, AwPermissionRequest::AwPermissionRequest::Sensors); |
| 671 } |
| 672 |
| 673 void AwContents::RequestSensorPermission( |
| 674 const GURL& origin, |
| 675 const base::Callback<void(bool)>& callback) { |
| 676 permission_request_handler_->SendRequest( |
| 677 std::unique_ptr<AwPermissionRequestDelegate>(new SimplePermissionRequest( |
| 678 origin, AwPermissionRequest::Sensors, callback))); |
| 679 } |
| 680 |
| 681 void AwContents::CancelSensorPermissionRequests(const GURL& origin) { |
| 682 permission_request_handler_->CancelRequest( |
| 683 origin, AwPermissionRequest::AwPermissionRequest::Sensors); |
| 684 } |
| 685 |
660 void AwContents::FindAllAsync(JNIEnv* env, | 686 void AwContents::FindAllAsync(JNIEnv* env, |
661 const JavaParamRef<jobject>& obj, | 687 const JavaParamRef<jobject>& obj, |
662 const JavaParamRef<jstring>& search_string) { | 688 const JavaParamRef<jstring>& search_string) { |
663 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 689 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
664 GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string)); | 690 GetFindHelper()->FindAllAsync(ConvertJavaStringToUTF16(env, search_string)); |
665 } | 691 } |
666 | 692 |
667 void AwContents::FindNext(JNIEnv* env, | 693 void AwContents::FindNext(JNIEnv* env, |
668 const JavaParamRef<jobject>& obj, | 694 const JavaParamRef<jobject>& obj, |
669 jboolean forward) { | 695 jboolean forward) { |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 int routing_id = new_host->GetRoutingID(); | 1288 int routing_id = new_host->GetRoutingID(); |
1263 // At this point, the current RVH may or may not contain a compositor. So | 1289 // At this point, the current RVH may or may not contain a compositor. So |
1264 // compositor_ may be nullptr, in which case | 1290 // compositor_ may be nullptr, in which case |
1265 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the | 1291 // BrowserViewRenderer::DidInitializeCompositor() callback is time when the |
1266 // new compositor is constructed. | 1292 // new compositor is constructed. |
1267 browser_view_renderer_.SetActiveCompositorID( | 1293 browser_view_renderer_.SetActiveCompositorID( |
1268 CompositorID(process_id, routing_id)); | 1294 CompositorID(process_id, routing_id)); |
1269 } | 1295 } |
1270 | 1296 |
1271 } // namespace android_webview | 1297 } // namespace android_webview |
OLD | NEW |