| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_COCOA_STATUS_BUBBLE_MAC_H_ | 5 #ifndef CHROME_BROWSER_COCOA_STATUS_BUBBLE_MAC_H_ |
| 6 #define CHROME_BROWSER_COCOA_STATUS_BUBBLE_MAC_H_ | 6 #define CHROME_BROWSER_COCOA_STATUS_BUBBLE_MAC_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // that state changes can be observed by unit tests. | 56 // that state changes can be observed by unit tests. |
| 57 void SetState(StatusBubbleState state); | 57 void SetState(StatusBubbleState state); |
| 58 | 58 |
| 59 // Sets the bubble text for SetStatus and SetURL. | 59 // Sets the bubble text for SetStatus and SetURL. |
| 60 void SetText(const std::wstring& text, bool is_url); | 60 void SetText(const std::wstring& text, bool is_url); |
| 61 | 61 |
| 62 // Construct the window/widget if it does not already exist. (Safe to call if | 62 // Construct the window/widget if it does not already exist. (Safe to call if |
| 63 // it does.) | 63 // it does.) |
| 64 void Create(); | 64 void Create(); |
| 65 | 65 |
| 66 // Attaches the status bubble window to its parent window. | 66 // Attaches the status bubble window to its parent window. Safe to call even |
| 67 // when already attached. |
| 67 void Attach(); | 68 void Attach(); |
| 68 | 69 |
| 70 // Detaches the status bubble window from its parent window. |
| 71 void Detach(); |
| 72 |
| 73 // Is the status bubble attached to the browser window? It should be attached |
| 74 // when shown and during any fades, but should be detached when hidden. |
| 75 bool is_attached() { return [window_ parentWindow] != nil; } |
| 76 |
| 69 // Begins fading the status bubble window in or out depending on the value | 77 // Begins fading the status bubble window in or out depending on the value |
| 70 // of |show|. This must be called from the appropriate fade state, | 78 // of |show|. This must be called from the appropriate fade state, |
| 71 // kBubbleShowingFadeIn or kBubbleHidingFadeOut, or from the appropriate | 79 // kBubbleShowingFadeIn or kBubbleHidingFadeOut, or from the appropriate |
| 72 // fully-shown/hidden state, kBubbleShown or kBubbleHidden. This may be | 80 // fully-shown/hidden state, kBubbleShown or kBubbleHidden. This may be |
| 73 // called at any point during a fade-in or fade-out; it is even possible to | 81 // called at any point during a fade-in or fade-out; it is even possible to |
| 74 // reverse a transition before it has completed. | 82 // reverse a transition before it has completed. |
| 75 void Fade(bool show); | 83 void Fade(bool show); |
| 76 | 84 |
| 77 // One-shot timer operations to manage the delays associated with the | 85 // One-shot timer operations to manage the delays associated with the |
| 78 // kBubbleShowingTimer and kBubbleHidingTimer states. StartTimer and | 86 // kBubbleShowingTimer and kBubbleHidingTimer states. StartTimer and |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 @interface NSObject(StatusBubbleDelegate) | 134 @interface NSObject(StatusBubbleDelegate) |
| 127 // Called to query the delegate about the vertical offset (if any) that should | 135 // Called to query the delegate about the vertical offset (if any) that should |
| 128 // be applied to the StatusBubble's position. | 136 // be applied to the StatusBubble's position. |
| 129 - (float)verticalOffsetForStatusBubble; | 137 - (float)verticalOffsetForStatusBubble; |
| 130 | 138 |
| 131 // Called from SetState to notify the delegate of state changes. | 139 // Called from SetState to notify the delegate of state changes. |
| 132 - (void)statusBubbleWillEnterState:(StatusBubbleMac::StatusBubbleState)state; | 140 - (void)statusBubbleWillEnterState:(StatusBubbleMac::StatusBubbleState)state; |
| 133 @end | 141 @end |
| 134 | 142 |
| 135 #endif // #ifndef CHROME_BROWSER_COCOA_STATUS_BUBBLE_MAC_H_ | 143 #endif // #ifndef CHROME_BROWSER_COCOA_STATUS_BUBBLE_MAC_H_ |
| OLD | NEW |