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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 | 8 |
9 @class InfoBubbleView; | 9 @class InfoBubbleView; |
10 class TabStripModelObserverBridge; | 10 class TabStripModelObserverBridge; |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 // Non-nil only on 10.7+. Both weak, owned by AppKit. | 31 // Non-nil only on 10.7+. Both weak, owned by AppKit. |
32 // A local event tap that will dismiss the bubble when a click is delivered | 32 // A local event tap that will dismiss the bubble when a click is delivered |
33 // outside the window. This is needed because the window shares first | 33 // outside the window. This is needed because the window shares first |
34 // responder with its parent. | 34 // responder with its parent. |
35 id eventTap_; | 35 id eventTap_; |
36 // A notification observer that gets triggered when any window resigns key. | 36 // A notification observer that gets triggered when any window resigns key. |
37 id resignationObserver_; | 37 id resignationObserver_; |
38 // The controlled window should be the key window when it's opened. True by | 38 // The controlled window should be the key window when it's opened. True by |
39 // default. | 39 // default. |
40 bool shouldOpenAsKeyWindow_; | 40 BOOL shouldOpenAsKeyWindow_; |
Robert Sesek
2013/11/06 23:06:03
Thanks for this fix.
| |
41 // The bubble window should close if it (or its parent) resigns key status. | |
42 BOOL shouldCloseOnResignKey_; | |
41 } | 43 } |
42 | 44 |
43 @property(nonatomic, readonly) NSWindow* parentWindow; | 45 @property(nonatomic, readonly) NSWindow* parentWindow; |
44 // The point in base screen coordinates at which the bubble should open and the | 46 // The point in base screen coordinates at which the bubble should open and the |
45 // arrow tip points. | 47 // arrow tip points. |
46 @property(nonatomic, assign) NSPoint anchorPoint; | 48 @property(nonatomic, assign) NSPoint anchorPoint; |
47 @property(nonatomic, readonly) InfoBubbleView* bubble; | 49 @property(nonatomic, readonly) InfoBubbleView* bubble; |
48 @property(nonatomic, assign) bool shouldOpenAsKeyWindow; | 50 @property(nonatomic, assign) BOOL shouldOpenAsKeyWindow; |
51 // Controls if the bubble auto-closes if the user clicks outside the bubble. | |
52 @property(nonatomic, assign) BOOL shouldCloseOnResignKey; | |
49 | 53 |
50 // Creates a bubble. |nibPath| is just the basename, e.g. @"FirstRunBubble". | 54 // Creates a bubble. |nibPath| is just the basename, e.g. @"FirstRunBubble". |
51 // |anchoredAt| is in screen space. You need to call -showWindow: to make the | 55 // |anchoredAt| is in screen space. You need to call -showWindow: to make the |
52 // bubble visible. It will autorelease itself when the user dismisses the | 56 // bubble visible. It will autorelease itself when the user dismisses the |
53 // bubble. | 57 // bubble. |
54 // This is the designated initializer. | 58 // This is the designated initializer. |
55 - (id)initWithWindowNibPath:(NSString*)nibPath | 59 - (id)initWithWindowNibPath:(NSString*)nibPath |
56 parentWindow:(NSWindow*)parentWindow | 60 parentWindow:(NSWindow*)parentWindow |
57 anchoredAt:(NSPoint)anchoredAt; | 61 anchoredAt:(NSPoint)anchoredAt; |
58 | 62 |
(...skipping 21 matching lines...) Expand all Loading... | |
80 | 84 |
81 @end | 85 @end |
82 | 86 |
83 // Methods for use by subclasses. | 87 // Methods for use by subclasses. |
84 @interface BaseBubbleController (Protected) | 88 @interface BaseBubbleController (Protected) |
85 // Registers event taps *after* the window is shown so that the bubble is | 89 // Registers event taps *after* the window is shown so that the bubble is |
86 // dismissed when it resigns key. This only needs to be called if | 90 // dismissed when it resigns key. This only needs to be called if |
87 // |-showWindow:| is overriden and does not call super. Noop on OSes <10.7. | 91 // |-showWindow:| is overriden and does not call super. Noop on OSes <10.7. |
88 - (void)registerKeyStateEventTap; | 92 - (void)registerKeyStateEventTap; |
89 @end | 93 @end |
OLD | NEW |