| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 [window_ setMovableByWindowBackground:NO]; | 367 [window_ setMovableByWindowBackground:NO]; |
| 368 [window_ setBackgroundColor:[NSColor clearColor]]; | 368 [window_ setBackgroundColor:[NSColor clearColor]]; |
| 369 [window_ setLevel:NSNormalWindowLevel]; | 369 [window_ setLevel:NSNormalWindowLevel]; |
| 370 [window_ setOpaque:NO]; | 370 [window_ setOpaque:NO]; |
| 371 [window_ setHasShadow:NO]; | 371 [window_ setHasShadow:NO]; |
| 372 | 372 |
| 373 // We do not need to worry about the bubble outliving |parent_| because our | 373 // We do not need to worry about the bubble outliving |parent_| because our |
| 374 // teardown sequence in BWC guarantees that |parent_| outlives the status | 374 // teardown sequence in BWC guarantees that |parent_| outlives the status |
| 375 // bubble and that the StatusBubble is torn down completely prior to the | 375 // bubble and that the StatusBubble is torn down completely prior to the |
| 376 // window going away. | 376 // window going away. |
| 377 scoped_nsobject<BubbleView> view( | 377 base::scoped_nsobject<BubbleView> view( |
| 378 [[BubbleView alloc] initWithFrame:NSZeroRect themeProvider:parent_]); | 378 [[BubbleView alloc] initWithFrame:NSZeroRect themeProvider:parent_]); |
| 379 [window_ setContentView:view]; | 379 [window_ setContentView:view]; |
| 380 | 380 |
| 381 [window_ setAlphaValue:0.0]; | 381 [window_ setAlphaValue:0.0]; |
| 382 | 382 |
| 383 // TODO(dtseng): Ignore until we provide NSAccessibility support. | 383 // TODO(dtseng): Ignore until we provide NSAccessibility support. |
| 384 [window_ accessibilitySetOverrideValue:NSAccessibilityUnknownRole | 384 [window_ accessibilitySetOverrideValue:NSAccessibilityUnknownRole |
| 385 forAttribute:NSAccessibilityRoleAttribute]; | 385 forAttribute:NSAccessibilityRoleAttribute]; |
| 386 | 386 |
| 387 // Set a delegate for the fade-in and fade-out transitions to be notified | 387 // Set a delegate for the fade-in and fade-out transitions to be notified |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 } | 740 } |
| 741 | 741 |
| 742 // Round the top corners when the bubble is below the parent window. | 742 // Round the top corners when the bubble is below the parent window. |
| 743 if (NSMinY(window_frame) < NSMinY(parent_frame)) { | 743 if (NSMinY(window_frame) < NSMinY(parent_frame)) { |
| 744 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; | 744 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 | 747 |
| 748 return corner_flags; | 748 return corner_flags; |
| 749 } | 749 } |
| OLD | NEW |