| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 // We do not need to worry about the bubble outliving |parent_| because our | 370 // We do not need to worry about the bubble outliving |parent_| because our |
| 371 // teardown sequence in BWC guarantees that |parent_| outlives the status | 371 // teardown sequence in BWC guarantees that |parent_| outlives the status |
| 372 // bubble and that the StatusBubble is torn down completely prior to the | 372 // bubble and that the StatusBubble is torn down completely prior to the |
| 373 // window going away. | 373 // window going away. |
| 374 scoped_nsobject<BubbleView> view( | 374 scoped_nsobject<BubbleView> view( |
| 375 [[BubbleView alloc] initWithFrame:NSZeroRect themeProvider:parent_]); | 375 [[BubbleView alloc] initWithFrame:NSZeroRect themeProvider:parent_]); |
| 376 [window_ setContentView:view]; | 376 [window_ setContentView:view]; |
| 377 | 377 |
| 378 [window_ setAlphaValue:0.0]; | 378 [window_ setAlphaValue:0.0]; |
| 379 | 379 |
| 380 // TODO(dtseng): Ignore until we provide NSAccessibility support. |
| 381 [window_ accessibilitySetOverrideValue:NSAccessibilityUnknownRole |
| 382 forAttribute:NSAccessibilityRoleAttribute]; |
| 383 |
| 380 // Set a delegate for the fade-in and fade-out transitions to be notified | 384 // Set a delegate for the fade-in and fade-out transitions to be notified |
| 381 // when fades are complete. The ownership model is for window_ to own | 385 // when fades are complete. The ownership model is for window_ to own |
| 382 // animation_dictionary, which owns animation, which owns | 386 // animation_dictionary, which owns animation, which owns |
| 383 // animation_delegate. | 387 // animation_delegate. |
| 384 CAAnimation* animation = [[window_ animationForKey:kFadeAnimationKey] copy]; | 388 CAAnimation* animation = [[window_ animationForKey:kFadeAnimationKey] copy]; |
| 385 [animation autorelease]; | 389 [animation autorelease]; |
| 386 StatusBubbleAnimationDelegate* animation_delegate = | 390 StatusBubbleAnimationDelegate* animation_delegate = |
| 387 [[StatusBubbleAnimationDelegate alloc] initWithStatusBubble:this]; | 391 [[StatusBubbleAnimationDelegate alloc] initWithStatusBubble:this]; |
| 388 [animation_delegate autorelease]; | 392 [animation_delegate autorelease]; |
| 389 [animation setDelegate:animation_delegate]; | 393 [animation setDelegate:animation_delegate]; |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } | 728 } |
| 725 | 729 |
| 726 // Round the top corners when the bubble is below the parent window. | 730 // Round the top corners when the bubble is below the parent window. |
| 727 if (NSMinY(window_frame) < NSMinY(parent_frame)) { | 731 if (NSMinY(window_frame) < NSMinY(parent_frame)) { |
| 728 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; | 732 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; |
| 729 } | 733 } |
| 730 } | 734 } |
| 731 | 735 |
| 732 return corner_flags; | 736 return corner_flags; |
| 733 } | 737 } |
| OLD | NEW |