| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_host_mac.h" | 5 #include "chrome/browser/extensions/extension_host_mac.h" |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 7 #include "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
| 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 9 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" | 9 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" |
| 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 11 #include "chrome/common/native_web_keyboard_event.h" | 11 #include "content/common/native_web_keyboard_event.h" |
| 12 | 12 |
| 13 ExtensionHostMac::~ExtensionHostMac() { | 13 ExtensionHostMac::~ExtensionHostMac() { |
| 14 // If there is a popup open for this host's extension, close it. | 14 // If there is a popup open for this host's extension, close it. |
| 15 ExtensionPopupController* popup = [ExtensionPopupController popup]; | 15 ExtensionPopupController* popup = [ExtensionPopupController popup]; |
| 16 if ([[popup window] isVisible] && | 16 if ([[popup window] isVisible] && |
| 17 [popup extensionHost]->extension() == this->extension()) { | 17 [popup extensionHost]->extension() == this->extension()) { |
| 18 InfoBubbleWindow* window = (InfoBubbleWindow*)[popup window]; | 18 InfoBubbleWindow* window = (InfoBubbleWindow*)[popup window]; |
| 19 [window setDelayOnClose:NO]; | 19 [window setDelayOnClose:NO]; |
| 20 [popup close]; | 20 [popup close]; |
| 21 } | 21 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char || | 53 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char || |
| 54 extension_host_type() != ViewType::EXTENSION_POPUP) { | 54 extension_host_type() != ViewType::EXTENSION_POPUP) { |
| 55 return; | 55 return; |
| 56 } | 56 } |
| 57 | 57 |
| 58 ChromeEventProcessingWindow* event_window = | 58 ChromeEventProcessingWindow* event_window = |
| 59 static_cast<ChromeEventProcessingWindow*>([view()->native_view() window]); | 59 static_cast<ChromeEventProcessingWindow*>([view()->native_view() window]); |
| 60 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]); | 60 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]); |
| 61 [event_window redispatchKeyEvent:event.os_event]; | 61 [event_window redispatchKeyEvent:event.os_event]; |
| 62 } | 62 } |
| OLD | NEW |