Chromium Code Reviews| 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 928 int browser_plugin_instance_id, | 928 int browser_plugin_instance_id, |
| 929 int before, | 929 int before, |
| 930 int after) { | 930 int after) { |
| 931 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>( | 931 RenderFrameHostImpl* rfh = static_cast<RenderFrameHostImpl*>( |
| 932 web_contents()->GetFocusedFrame()); | 932 web_contents()->GetFocusedFrame()); |
| 933 if (rfh) | 933 if (rfh) |
| 934 rfh->ExtendSelectionAndDelete(before, after); | 934 rfh->ExtendSelectionAndDelete(before, after); |
| 935 } | 935 } |
| 936 | 936 |
| 937 void BrowserPluginGuest::OnLockMouse(bool user_gesture, | 937 void BrowserPluginGuest::OnLockMouse(bool user_gesture, |
| 938 bool last_unlocked_by_target, | |
| 939 bool privileged) { | 938 bool privileged) { |
| 940 if (pending_lock_request_) { | 939 if (pending_lock_request_) { |
| 941 // Immediately reject the lock because only one pointerLock may be active | 940 // Immediately reject the lock because only one pointerLock may be active |
| 942 // at a time. | 941 // at a time. |
| 943 Send(new ViewMsg_LockMouse_ACK(routing_id(), false)); | 942 Send(new ViewMsg_LockMouse_ACK(routing_id(), false)); |
| 944 return; | 943 return; |
| 945 } | 944 } |
| 946 | 945 |
| 947 pending_lock_request_ = true; | 946 pending_lock_request_ = true; |
| 948 | 947 |
| 948 RenderWidgetHostImpl* owner = GetOwnerRenderWidgetHost(); | |
| 949 const bool is_last_unlocked_by_target = | |
|
jochen (gone - plz use gerrit)
2017/06/06 14:59:47
why const? that looks unusual..
chongz
2017/06/06 17:11:38
Done. Hmmm I though we prefer using 'const', no...
| |
| 950 owner ? owner->is_last_unlocked_by_target() : false; | |
| 951 | |
| 949 delegate_->RequestPointerLockPermission( | 952 delegate_->RequestPointerLockPermission( |
| 950 user_gesture, | 953 user_gesture, is_last_unlocked_by_target, |
| 951 last_unlocked_by_target, | |
| 952 base::Bind(&BrowserPluginGuest::PointerLockPermissionResponse, | 954 base::Bind(&BrowserPluginGuest::PointerLockPermissionResponse, |
| 953 weak_ptr_factory_.GetWeakPtr())); | 955 weak_ptr_factory_.GetWeakPtr())); |
| 954 } | 956 } |
| 955 | 957 |
| 956 void BrowserPluginGuest::OnLockMouseAck(int browser_plugin_instance_id, | 958 void BrowserPluginGuest::OnLockMouseAck(int browser_plugin_instance_id, |
| 957 bool succeeded) { | 959 bool succeeded) { |
| 958 Send(new ViewMsg_LockMouse_ACK(routing_id(), succeeded)); | 960 Send(new ViewMsg_LockMouse_ACK(routing_id(), succeeded)); |
| 959 pending_lock_request_ = false; | 961 pending_lock_request_ = false; |
| 960 if (succeeded) | 962 if (succeeded) |
| 961 mouse_locked_ = true; | 963 mouse_locked_ = true; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1069 range, character_bounds); | 1071 range, character_bounds); |
| 1070 } | 1072 } |
| 1071 #endif | 1073 #endif |
| 1072 | 1074 |
| 1073 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1075 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 1074 if (delegate_) | 1076 if (delegate_) |
| 1075 delegate_->SetContextMenuPosition(position); | 1077 delegate_->SetContextMenuPosition(position); |
| 1076 } | 1078 } |
| 1077 | 1079 |
| 1078 } // namespace content | 1080 } // namespace content |
| OLD | NEW |