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 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" | 5 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // At this point, -animationForKey should have been called by CoreAnimation | 136 // At this point, -animationForKey should have been called by CoreAnimation |
137 // to set up the animation to run. Verify this. | 137 // to set up the animation to run. Verify this. |
138 DCHECK(completionHandler_ == nil); | 138 DCHECK(completionHandler_ == nil); |
139 [NSAnimationContext endGrouping]; | 139 [NSAnimationContext endGrouping]; |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 @end | 143 @end |
144 | 144 |
145 StatusBubbleMac::StatusBubbleMac(NSWindow* parent, id delegate) | 145 StatusBubbleMac::StatusBubbleMac(NSWindow* parent, id delegate) |
146 : timer_factory_(this), | 146 : parent_(parent), |
147 expand_timer_factory_(this), | |
148 completion_handler_factory_(this), | |
149 parent_(parent), | |
150 delegate_(delegate), | 147 delegate_(delegate), |
151 window_(nil), | 148 window_(nil), |
152 status_text_(nil), | 149 status_text_(nil), |
153 url_text_(nil), | 150 url_text_(nil), |
154 state_(kBubbleHidden), | 151 state_(kBubbleHidden), |
155 immediate_(false), | 152 immediate_(false), |
156 is_expanded_(false) { | 153 is_expanded_(false), |
| 154 timer_factory_(this), |
| 155 expand_timer_factory_(this), |
| 156 completion_handler_factory_(this) { |
157 Create(); | 157 Create(); |
158 Attach(); | 158 Attach(); |
159 } | 159 } |
160 | 160 |
161 StatusBubbleMac::~StatusBubbleMac() { | 161 StatusBubbleMac::~StatusBubbleMac() { |
162 DCHECK(window_); | 162 DCHECK(window_); |
163 | 163 |
164 Hide(); | 164 Hide(); |
165 | 165 |
166 completion_handler_factory_.InvalidateWeakPtrs(); | 166 completion_handler_factory_.InvalidateWeakPtrs(); |
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 } | 775 } |
776 | 776 |
777 // Round the top corners when the bubble is below the parent window. | 777 // Round the top corners when the bubble is below the parent window. |
778 if (NSMinY(window_frame) < NSMinY(parent_frame)) { | 778 if (NSMinY(window_frame) < NSMinY(parent_frame)) { |
779 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; | 779 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; |
780 } | 780 } |
781 } | 781 } |
782 | 782 |
783 return corner_flags; | 783 return corner_flags; |
784 } | 784 } |
OLD | NEW |