| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/guest_view/web_view/web_view_guest.h" | 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 bool WebViewGuest::HandleKeyboardShortcuts( | 1054 bool WebViewGuest::HandleKeyboardShortcuts( |
| 1055 const content::NativeWebKeyboardEvent& event) { | 1055 const content::NativeWebKeyboardEvent& event) { |
| 1056 // <webview> outside of Chrome Apps do not handle keyboard shortcuts. | 1056 // <webview> outside of Chrome Apps do not handle keyboard shortcuts. |
| 1057 if (!GuestViewManager::FromBrowserContext(browser_context())-> | 1057 if (!GuestViewManager::FromBrowserContext(browser_context())-> |
| 1058 IsOwnedByExtension(this)) { | 1058 IsOwnedByExtension(this)) { |
| 1059 return false; | 1059 return false; |
| 1060 } | 1060 } |
| 1061 | 1061 |
| 1062 if (event.type != blink::WebInputEvent::RawKeyDown) | 1062 if (event.type() != blink::WebInputEvent::RawKeyDown) |
| 1063 return false; | 1063 return false; |
| 1064 | 1064 |
| 1065 // If the user hits the escape key without any modifiers then unlock the | 1065 // If the user hits the escape key without any modifiers then unlock the |
| 1066 // mouse if necessary. | 1066 // mouse if necessary. |
| 1067 if ((event.windowsKeyCode == ui::VKEY_ESCAPE) && | 1067 if ((event.windowsKeyCode == ui::VKEY_ESCAPE) && |
| 1068 !(event.modifiers & blink::WebInputEvent::InputModifiers)) { | 1068 !(event.modifiers() & blink::WebInputEvent::InputModifiers)) { |
| 1069 return web_contents()->GotResponseToLockMouseRequest(false); | 1069 return web_contents()->GotResponseToLockMouseRequest(false); |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 #if defined(OS_MACOSX) | 1072 #if defined(OS_MACOSX) |
| 1073 if (event.modifiers != blink::WebInputEvent::MetaKey) | 1073 if (event.modifiers() != blink::WebInputEvent::MetaKey) |
| 1074 return false; | 1074 return false; |
| 1075 | 1075 |
| 1076 if (event.windowsKeyCode == ui::VKEY_OEM_4) { | 1076 if (event.windowsKeyCode == ui::VKEY_OEM_4) { |
| 1077 Go(-1); | 1077 Go(-1); |
| 1078 return true; | 1078 return true; |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 if (event.windowsKeyCode == ui::VKEY_OEM_6) { | 1081 if (event.windowsKeyCode == ui::VKEY_OEM_6) { |
| 1082 Go(1); | 1082 Go(1); |
| 1083 return true; | 1083 return true; |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1524 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1525 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1525 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
| 1526 webview::kEventExitFullscreen, std::move(args))); | 1526 webview::kEventExitFullscreen, std::move(args))); |
| 1527 } | 1527 } |
| 1528 // Since we changed fullscreen state, sending a Resize message ensures that | 1528 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1529 // renderer/ sees the change. | 1529 // renderer/ sees the change. |
| 1530 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1530 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
| 1531 } | 1531 } |
| 1532 | 1532 |
| 1533 } // namespace extensions | 1533 } // namespace extensions |
| OLD | NEW |