| 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 "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 5 #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 gfx::Size max_size(ExtensionViewMac::kMaxWidth, | 62 gfx::Size max_size(ExtensionViewMac::kMaxWidth, |
| 63 ExtensionViewMac::kMaxHeight); | 63 ExtensionViewMac::kMaxHeight); |
| 64 render_view_host()->EnableAutoResize(min_size, max_size); | 64 render_view_host()->EnableAutoResize(min_size, max_size); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ExtensionViewMac::HandleKeyboardEvent( | 68 void ExtensionViewMac::HandleKeyboardEvent( |
| 69 content::WebContents* source, | 69 content::WebContents* source, |
| 70 const content::NativeWebKeyboardEvent& event) { | 70 const content::NativeWebKeyboardEvent& event) { |
| 71 if (event.skip_in_browser || | 71 if (event.skip_in_browser || |
| 72 event.type == content::NativeWebKeyboardEvent::Char || | 72 event.type() == content::NativeWebKeyboardEvent::Char || |
| 73 extension_host_->extension_host_type() != | 73 extension_host_->extension_host_type() != |
| 74 extensions::VIEW_TYPE_EXTENSION_POPUP) | 74 extensions::VIEW_TYPE_EXTENSION_POPUP) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 ChromeEventProcessingWindow* event_window = | 77 ChromeEventProcessingWindow* event_window = |
| 78 base::mac::ObjCCastStrict<ChromeEventProcessingWindow>( | 78 base::mac::ObjCCastStrict<ChromeEventProcessingWindow>( |
| 79 [GetNativeView() window]); | 79 [GetNativeView() window]); |
| 80 [event_window redispatchKeyEvent:event.os_event]; | 80 [event_window redispatchKeyEvent:event.os_event]; |
| 81 } | 81 } |
| 82 | 82 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 101 namespace extensions { | 101 namespace extensions { |
| 102 | 102 |
| 103 // static | 103 // static |
| 104 std::unique_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( | 104 std::unique_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( |
| 105 ExtensionViewHost* host, | 105 ExtensionViewHost* host, |
| 106 Browser* browser) { | 106 Browser* browser) { |
| 107 return base::MakeUnique<ExtensionViewMac>(host, browser); | 107 return base::MakeUnique<ExtensionViewMac>(host, browser); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace extensions | 110 } // namespace extensions |
| OLD | NEW |