Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Side by Side Diff: chrome/browser/extensions/extension_host_mac.mm

Issue 10824030: Move ExtensionHost into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 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/extensions/extension_host_mac.h" 5 #include "chrome/browser/extensions/extension_host_mac.h"
6 6
7 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" 7 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
8 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" 8 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
9 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 9 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
10 #include "chrome/common/view_type.h" 10 #include "chrome/common/view_type.h"
11 #include "content/public/browser/native_web_keyboard_event.h" 11 #include "content/public/browser/native_web_keyboard_event.h"
12 12
13 using content::NativeWebKeyboardEvent; 13 using content::NativeWebKeyboardEvent;
14 14
15 namespace extensions {
16
15 ExtensionHostMac::~ExtensionHostMac() { 17 ExtensionHostMac::~ExtensionHostMac() {
16 // If there is a popup open for this host's extension, close it. 18 // If there is a popup open for this host's extension, close it.
17 ExtensionPopupController* popup = [ExtensionPopupController popup]; 19 ExtensionPopupController* popup = [ExtensionPopupController popup];
18 if ([[popup window] isVisible] && 20 if ([[popup window] isVisible] &&
19 [popup extensionHost]->extension() == this->extension()) { 21 [popup extensionHost]->extension() == this->extension()) {
20 InfoBubbleWindow* window = (InfoBubbleWindow*)[popup window]; 22 InfoBubbleWindow* window = (InfoBubbleWindow*)[popup window];
21 [window setDelayOnClose:NO]; 23 [window setDelayOnClose:NO];
22 [popup close]; 24 [popup close];
23 } 25 }
24 } 26 }
25 27
26 void ExtensionHostMac::UnhandledKeyboardEvent( 28 void ExtensionHostMac::UnhandledKeyboardEvent(
27 const NativeWebKeyboardEvent& event) { 29 const NativeWebKeyboardEvent& event) {
28 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char || 30 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char ||
29 extension_host_type() != chrome::VIEW_TYPE_EXTENSION_POPUP) { 31 extension_host_type() != chrome::VIEW_TYPE_EXTENSION_POPUP) {
30 return; 32 return;
31 } 33 }
32 34
33 ChromeEventProcessingWindow* event_window = 35 ChromeEventProcessingWindow* event_window =
34 static_cast<ChromeEventProcessingWindow*>([view()->native_view() window]); 36 static_cast<ChromeEventProcessingWindow*>([view()->native_view() window]);
35 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]); 37 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]);
36 [event_window redispatchKeyEvent:event.os_event]; 38 [event_window redispatchKeyEvent:event.os_event];
37 } 39 }
40
41 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host_mac.h ('k') | chrome/browser/extensions/extension_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698