| 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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 bool WebViewGuest::HandleKeyboardShortcuts( | 1057 bool WebViewGuest::HandleKeyboardShortcuts( |
| 1058 const content::NativeWebKeyboardEvent& event) { | 1058 const content::NativeWebKeyboardEvent& event) { |
| 1059 // <webview> outside of Chrome Apps do not handle keyboard shortcuts. | 1059 // <webview> outside of Chrome Apps do not handle keyboard shortcuts. |
| 1060 if (!GuestViewManager::FromBrowserContext(browser_context())-> | 1060 if (!GuestViewManager::FromBrowserContext(browser_context())-> |
| 1061 IsOwnedByExtension(this)) { | 1061 IsOwnedByExtension(this)) { |
| 1062 return false; | 1062 return false; |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 if (event.type != blink::WebInputEvent::RawKeyDown) | 1065 if (event.type() != blink::WebInputEvent::RawKeyDown) |
| 1066 return false; | 1066 return false; |
| 1067 | 1067 |
| 1068 // If the user hits the escape key without any modifiers then unlock the | 1068 // If the user hits the escape key without any modifiers then unlock the |
| 1069 // mouse if necessary. | 1069 // mouse if necessary. |
| 1070 if ((event.windowsKeyCode == ui::VKEY_ESCAPE) && | 1070 if ((event.windowsKeyCode == ui::VKEY_ESCAPE) && |
| 1071 !(event.modifiers & blink::WebInputEvent::InputModifiers)) { | 1071 !(event.modifiers() & blink::WebInputEvent::InputModifiers)) { |
| 1072 return web_contents()->GotResponseToLockMouseRequest(false); | 1072 return web_contents()->GotResponseToLockMouseRequest(false); |
| 1073 } | 1073 } |
| 1074 | 1074 |
| 1075 #if defined(OS_MACOSX) | 1075 #if defined(OS_MACOSX) |
| 1076 if (event.modifiers != blink::WebInputEvent::MetaKey) | 1076 if (event.modifiers != blink::WebInputEvent::MetaKey) |
| 1077 return false; | 1077 return false; |
| 1078 | 1078 |
| 1079 if (event.windowsKeyCode == ui::VKEY_OEM_4) { | 1079 if (event.windowsKeyCode == ui::VKEY_OEM_4) { |
| 1080 Go(-1); | 1080 Go(-1); |
| 1081 return true; | 1081 return true; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1517 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1517 std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1518 DispatchEventToView(base::MakeUnique<GuestViewEvent>( | 1518 DispatchEventToView(base::MakeUnique<GuestViewEvent>( |
| 1519 webview::kEventExitFullscreen, std::move(args))); | 1519 webview::kEventExitFullscreen, std::move(args))); |
| 1520 } | 1520 } |
| 1521 // Since we changed fullscreen state, sending a Resize message ensures that | 1521 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1522 // renderer/ sees the change. | 1522 // renderer/ sees the change. |
| 1523 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); | 1523 web_contents()->GetRenderViewHost()->GetWidget()->WasResized(); |
| 1524 } | 1524 } |
| 1525 | 1525 |
| 1526 } // namespace extensions | 1526 } // namespace extensions |
| OLD | NEW |