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

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

Issue 363233002: Abstract base 'ExtensionView' to Fix DEPS violation in extension_view_host.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase for r281699 (unused hwnd_util.h) Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_view_host_mac.h" 5 #include "chrome/browser/extensions/extension_view_host_mac.h"
6 6
7 #import "base/mac/foundation_util.h" 7 #import "base/mac/foundation_util.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 "content/public/browser/native_web_keyboard_event.h"
12
13 using content::NativeWebKeyboardEvent;
14 11
15 namespace extensions { 12 namespace extensions {
16 13
17 ExtensionViewHostMac::~ExtensionViewHostMac() { 14 ExtensionViewHostMac::~ExtensionViewHostMac() {
18 // If there is a popup open for this host's extension, close it. 15 // If there is a popup open for this host's extension, close it.
19 ExtensionPopupController* popup = [ExtensionPopupController popup]; 16 ExtensionPopupController* popup = [ExtensionPopupController popup];
20 InfoBubbleWindow* window = 17 InfoBubbleWindow* window =
21 base::mac::ObjCCast<InfoBubbleWindow>([popup window]); 18 base::mac::ObjCCast<InfoBubbleWindow>([popup window]);
22 if ([window isVisible] && [popup extensionViewHost] == this) { 19 if ([window isVisible] && [popup extensionViewHost] == this) {
23 [window setAllowedAnimations:info_bubble::kAnimateNone]; 20 [window setAllowedAnimations:info_bubble::kAnimateNone];
24 [popup close]; 21 [popup close];
25 } 22 }
26 } 23 }
27 24
28 void ExtensionViewHostMac::UnhandledKeyboardEvent(
29 content::WebContents* source,
30 const NativeWebKeyboardEvent& event) {
31 if (event.skip_in_browser || event.type == NativeWebKeyboardEvent::Char ||
32 extension_host_type() != VIEW_TYPE_EXTENSION_POPUP) {
33 return;
34 }
35
36 ChromeEventProcessingWindow* event_window =
37 static_cast<ChromeEventProcessingWindow*>([view()->native_view() window]);
38 DCHECK([event_window isKindOfClass:[ChromeEventProcessingWindow class]]);
39 [event_window redispatchKeyEvent:event.os_event];
40 }
41
42 } // namespace extensions 25 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_view_host_mac.h ('k') | chrome/browser/ui/android/extensions/extension_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698