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 #include "chrome/browser/cocoa/status_bubble_mac.h" | 5 #include "chrome/browser/cocoa/status_bubble_mac.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "app/text_elider.h" | 9 #include "app/text_elider.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // The width of the bubble in relation to the width of the parent window. | 25 // The width of the bubble in relation to the width of the parent window. |
26 const double kWindowWidthPercent = 1.0 / 3.0; | 26 const double kWindowWidthPercent = 1.0 / 3.0; |
27 | 27 |
28 // How close the mouse can get to the infobubble before it starts sliding | 28 // How close the mouse can get to the infobubble before it starts sliding |
29 // off-screen. | 29 // off-screen. |
30 const int kMousePadding = 20; | 30 const int kMousePadding = 20; |
31 | 31 |
32 const int kTextPadding = 3; | 32 const int kTextPadding = 3; |
33 | 33 |
34 // The animation key used for fade-in and fade-out transitions. | 34 // The animation key used for fade-in and fade-out transitions. |
35 const NSString* kFadeAnimationKey = @"alphaValue"; | 35 NSString* const kFadeAnimationKey = @"alphaValue"; |
36 | 36 |
37 // The status bubble's maximum opacity, when fully faded in. | 37 // The status bubble's maximum opacity, when fully faded in. |
38 const CGFloat kBubbleOpacity = 1.0; | 38 const CGFloat kBubbleOpacity = 1.0; |
39 | 39 |
40 // Delay before showing or hiding the bubble after a SetStatus or SetURL call. | 40 // Delay before showing or hiding the bubble after a SetStatus or SetURL call. |
41 const int64 kShowDelayMilliseconds = 80; | 41 const int64 kShowDelayMilliseconds = 80; |
42 const int64 kHideDelayMilliseconds = 250; | 42 const int64 kHideDelayMilliseconds = 250; |
43 | 43 |
44 // How long each fade should last. | 44 // How long each fade should last. |
45 const NSTimeInterval kShowFadeInDurationSeconds = 0.120; | 45 const NSTimeInterval kShowFadeInDurationSeconds = 0.120; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 DCHECK(parent_); | 561 DCHECK(parent_); |
562 | 562 |
563 NSSize size = NSMakeSize(0, kWindowHeight); | 563 NSSize size = NSMakeSize(0, kWindowHeight); |
564 size = [[parent_ contentView] convertSize:size toView:nil]; | 564 size = [[parent_ contentView] convertSize:size toView:nil]; |
565 | 565 |
566 NSRect rect = [parent_ frame]; | 566 NSRect rect = [parent_ frame]; |
567 rect.size.height = size.height; | 567 rect.size.height = size.height; |
568 rect.size.width = static_cast<int>(kWindowWidthPercent * rect.size.width); | 568 rect.size.width = static_cast<int>(kWindowWidthPercent * rect.size.width); |
569 return rect; | 569 return rect; |
570 } | 570 } |
OLD | NEW |