Move atom_event_processing_window to browser/ui/cocoa.
This commit is contained in:
parent
9b07c2b894
commit
43711083f7
4 changed files with 15 additions and 15 deletions
4
atom.gyp
4
atom.gyp
|
@ -106,10 +106,10 @@
|
||||||
'browser/ui/accelerator_util.h',
|
'browser/ui/accelerator_util.h',
|
||||||
'browser/ui/accelerator_util_mac.mm',
|
'browser/ui/accelerator_util_mac.mm',
|
||||||
'browser/ui/accelerator_util_win.cc',
|
'browser/ui/accelerator_util_win.cc',
|
||||||
'browser/ui/atom_event_processing_window.h',
|
|
||||||
'browser/ui/atom_event_processing_window.mm',
|
|
||||||
'browser/ui/atom_menu_controller_mac.h',
|
'browser/ui/atom_menu_controller_mac.h',
|
||||||
'browser/ui/atom_menu_controller_mac.mm',
|
'browser/ui/atom_menu_controller_mac.mm',
|
||||||
|
'browser/ui/cocoa/event_processing_window.h',
|
||||||
|
'browser/ui/cocoa/event_processing_window.mm',
|
||||||
'browser/ui/cocoa/nsalert_synchronous_sheet.h',
|
'browser/ui/cocoa/nsalert_synchronous_sheet.h',
|
||||||
'browser/ui/cocoa/nsalert_synchronous_sheet.mm',
|
'browser/ui/cocoa/nsalert_synchronous_sheet.mm',
|
||||||
'browser/ui/file_dialog.h',
|
'browser/ui/file_dialog.h',
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "base/mac/scoped_nsobject.h"
|
#include "base/mac/scoped_nsobject.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#import "browser/ui/atom_event_processing_window.h"
|
#import "browser/ui/cocoa/event_processing_window.h"
|
||||||
#include "brightray/browser/inspectable_web_contents.h"
|
#include "brightray/browser/inspectable_web_contents.h"
|
||||||
#include "brightray/browser/inspectable_web_contents_view.h"
|
#include "brightray/browser/inspectable_web_contents_view.h"
|
||||||
#include "common/draggable_region.h"
|
#include "common/draggable_region.h"
|
||||||
|
@ -76,7 +76,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface AtomNSWindow : AtomEventProcessingWindow {
|
@interface AtomNSWindow : EventProcessingWindow {
|
||||||
@protected
|
@protected
|
||||||
atom::NativeWindowMac* shell_;
|
atom::NativeWindowMac* shell_;
|
||||||
}
|
}
|
||||||
|
@ -440,9 +440,9 @@ void NativeWindowMac::HandleKeyboardEvent(
|
||||||
event.type == content::NativeWebKeyboardEvent::Char)
|
event.type == content::NativeWebKeyboardEvent::Char)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AtomEventProcessingWindow* event_window =
|
EventProcessingWindow* event_window =
|
||||||
static_cast<AtomEventProcessingWindow*>(window());
|
static_cast<EventProcessingWindow*>(window());
|
||||||
DCHECK([event_window isKindOfClass:[AtomEventProcessingWindow class]]);
|
DCHECK([event_window isKindOfClass:[EventProcessingWindow class]]);
|
||||||
[event_window redispatchKeyEvent:event.os_event];
|
[event_window redispatchKeyEvent:event.os_event];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
|
#ifndef ATOM_BROWSER_UI_COCOA_EVENT_PROCESSING_WINDOW_H_
|
||||||
#define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
|
#define ATOM_BROWSER_UI_COCOA_EVENT_PROCESSING_WINDOW_H_
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
// Override NSWindow to access unhandled keyboard events (for command
|
// Override NSWindow to access unhandled keyboard events (for command
|
||||||
// processing); subclassing NSWindow is the only method to do
|
// processing); subclassing NSWindow is the only method to do
|
||||||
// this.
|
// this.
|
||||||
@interface AtomEventProcessingWindow : NSWindow {
|
@interface EventProcessingWindow : NSWindow {
|
||||||
@private
|
@private
|
||||||
BOOL redispatchingEvent_;
|
BOOL redispatchingEvent_;
|
||||||
BOOL eventHandled_;
|
BOOL eventHandled_;
|
||||||
|
@ -27,4 +27,4 @@
|
||||||
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent;
|
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_
|
#endif // ATOM_BROWSER_UI_COCOA_EVENT_PROCESSING_WINDOW_H_
|
|
@ -2,17 +2,17 @@
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#import "browser/ui/atom_event_processing_window.h"
|
#import "browser/ui/cocoa/event_processing_window.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#import "content/public/browser/render_widget_host_view_mac_base.h"
|
#import "content/public/browser/render_widget_host_view_mac_base.h"
|
||||||
|
|
||||||
@interface AtomEventProcessingWindow ()
|
@interface EventProcessingWindow ()
|
||||||
// Duplicate the given key event, but changing the associated window.
|
// Duplicate the given key event, but changing the associated window.
|
||||||
- (NSEvent*)keyEventForWindow:(NSWindow*)window fromKeyEvent:(NSEvent*)event;
|
- (NSEvent*)keyEventForWindow:(NSWindow*)window fromKeyEvent:(NSEvent*)event;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation AtomEventProcessingWindow
|
@implementation EventProcessingWindow
|
||||||
|
|
||||||
- (BOOL)redispatchKeyEvent:(NSEvent*)event {
|
- (BOOL)redispatchKeyEvent:(NSEvent*)event {
|
||||||
DCHECK(event);
|
DCHECK(event);
|
||||||
|
@ -103,4 +103,4 @@
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end // AtomEventProcessingWindow
|
@end // EventProcessingWindow
|
Loading…
Reference in a new issue