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

Unified Diff: ui/views/cocoa/bridged_content_view.mm

Issue 1259913003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150529-ViewsBrowser-DisableCertificateDialog
Patch Set: update comments, still a TODO Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/cocoa/bridged_content_view.h ('k') | ui/views/cocoa/bridged_native_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/cocoa/bridged_content_view.mm
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm
index 3a3e83962f17744628618a60069066f79731fb5e..30e884f889ab89708fc50b6a27a1b85662b79f1d 100644
--- a/ui/views/cocoa/bridged_content_view.mm
+++ b/ui/views/cocoa/bridged_content_view.mm
@@ -54,6 +54,8 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
return false;
}
+bool g_ignore_mouse_events = false;
+
} // namespace
@interface BridgedContentView ()
@@ -93,6 +95,7 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
@synthesize hostedView = hostedView_;
@synthesize textInputClient = textInputClient_;
+@synthesize ignoreMouseEvents = ignoreMouseEvents_;
@synthesize mouseDownCanMoveWindow = mouseDownCanMoveWindow_;
- (id)initWithView:(views::View*)viewToHost {
@@ -118,6 +121,11 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
return self;
}
+- (void)setIgnoreMouseEvents:(BOOL)flag {
+ ignoreMouseEvents_ = flag;
+ g_ignore_mouse_events = flag;
+}
+
- (void)clearView {
hostedView_ = NULL;
[cursorTrackingArea_.get() clearOwner];
@@ -125,6 +133,11 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
}
- (void)processCapturedMouseEvent:(NSEvent*)theEvent {
+ if (CGEventGetIntegerValueField([theEvent CGEvent], kCGEventSourceUserData)) {
+ DLOG(INFO) << "Ignoring generated event in capture.";
+ return;
+ }
+
if (!hostedView_)
return;
@@ -141,6 +154,7 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
ui::MouseEvent event(theEvent);
event.set_location(
MovePointToWindow([theEvent locationInWindow], source, target));
+ DLOG(INFO) << "processing captured event in window at: " << event.location().ToString();
hostedView_->GetWidget()->OnMouseEvent(&event);
}
@@ -259,11 +273,18 @@ bool DispatchEventToMenu(views::Widget* widget, ui::KeyboardCode key_code) {
// Translates the location of |theEvent| to toolkit-views coordinates and passes
// the event to NativeWidgetMac for handling.
- (void)mouseEvent:(NSEvent*)theEvent {
- if (!hostedView_)
+ if (CGEventGetIntegerValueField([theEvent CGEvent], kCGEventSourceUserData)) {
+ DLOG(INFO) << "Ignoring generated event [regular].";
+ return;
+ }
+
+ if (!hostedView_ || g_ignore_mouse_events)
return;
ui::MouseEvent event(theEvent);
+ //DLOG(INFO) << "processing regular mouse event event in window at: " << event.location().ToString();
+
// Aura updates tooltips with the help of aura::Window::AddPreTargetHandler().
// Mac hooks in here.
[self updateTooltipIfRequiredAt:event.location()];
« no previous file with comments | « ui/views/cocoa/bridged_content_view.h ('k') | ui/views/cocoa/bridged_native_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698