OLD | NEW |
1 // Copyright (c) 2012 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/logging.h" // for NOTREACHED() | 7 #include "base/logging.h" // for NOTREACHED() |
8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/sys_string_conversions.h" | 10 #include "base/sys_string_conversions.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 url:(const GURL&)url | 69 url:(const GURL&)url |
70 bubbleType:(FullscreenExitBubbleType)bubbleType { | 70 bubbleType:(FullscreenExitBubbleType)bubbleType { |
71 NSString* nibPath = | 71 NSString* nibPath = |
72 [base::mac::FrameworkBundle() pathForResource:@"FullscreenExitBubble" | 72 [base::mac::FrameworkBundle() pathForResource:@"FullscreenExitBubble" |
73 ofType:@"nib"]; | 73 ofType:@"nib"]; |
74 if ((self = [super initWithWindowNibPath:nibPath owner:self])) { | 74 if ((self = [super initWithWindowNibPath:nibPath owner:self])) { |
75 browser_ = browser; | 75 browser_ = browser; |
76 owner_ = owner; | 76 owner_ = owner; |
77 url_ = url; | 77 url_ = url; |
78 bubbleType_ = bubbleType; | 78 bubbleType_ = bubbleType; |
| 79 // Mouse lock expects mouse events to reach the main window immediately. |
| 80 // Make the bubble transparent for mouse events if mouse lock is enabled. |
| 81 if (bubbleType_ == FEB_TYPE_FULLSCREEN_MOUSELOCK_EXIT_INSTRUCTION || |
| 82 bubbleType_ == FEB_TYPE_MOUSELOCK_EXIT_INSTRUCTION) |
| 83 [[self window] setIgnoresMouseEvents:YES]; |
79 } | 84 } |
80 return self; | 85 return self; |
81 } | 86 } |
82 | 87 |
83 - (void)allow:(id)sender { | 88 - (void)allow:(id)sender { |
84 // The mouselock code expects that mouse events reach the main window | 89 // The mouselock code expects that mouse events reach the main window |
85 // immediately, but the cursor is still over the bubble, which eats the | 90 // immediately, but the cursor is still over the bubble, which eats the |
86 // mouse events. Make the bubble transparent for mouse events. | 91 // mouse events. Make the bubble transparent for mouse events. |
87 if (bubbleType_ == FEB_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS || | 92 if (bubbleType_ == FEB_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS || |
88 bubbleType_ == FEB_TYPE_MOUSELOCK_BUTTONS) | 93 bubbleType_ == FEB_TYPE_MOUSELOCK_BUTTONS) |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 - (void)hideSoon { | 332 - (void)hideSoon { |
328 hideTimer_.reset( | 333 hideTimer_.reset( |
329 [[NSTimer scheduledTimerWithTimeInterval:kInitialDelay | 334 [[NSTimer scheduledTimerWithTimeInterval:kInitialDelay |
330 target:self | 335 target:self |
331 selector:@selector(hideTimerFired:) | 336 selector:@selector(hideTimerFired:) |
332 userInfo:nil | 337 userInfo:nil |
333 repeats:NO] retain]); | 338 repeats:NO] retain]); |
334 } | 339 } |
335 | 340 |
336 @end | 341 @end |
OLD | NEW |