Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/ui/cocoa/status_bubble_mac.mm

Issue 1543393002: Switch to standard integer types in chrome/browser/ui/cocoa/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 // How close the mouse can get to the infobubble before it starts sliding 39 // How close the mouse can get to the infobubble before it starts sliding
40 // off-screen. 40 // off-screen.
41 const int kMousePadding = 20; 41 const int kMousePadding = 20;
42 42
43 const int kTextPadding = 3; 43 const int kTextPadding = 3;
44 44
45 // The status bubble's maximum opacity, when fully faded in. 45 // The status bubble's maximum opacity, when fully faded in.
46 const CGFloat kBubbleOpacity = 1.0; 46 const CGFloat kBubbleOpacity = 1.0;
47 47
48 // Delay before showing or hiding the bubble after a SetStatus or SetURL call. 48 // Delay before showing or hiding the bubble after a SetStatus or SetURL call.
49 const int64 kShowDelayMS = 80; 49 const int64_t kShowDelayMS = 80;
50 const int64 kHideDelayMS = 250; 50 const int64_t kHideDelayMS = 250;
51 51
52 // How long each fade should last. 52 // How long each fade should last.
53 const NSTimeInterval kShowFadeInDurationSeconds = 0.120; 53 const NSTimeInterval kShowFadeInDurationSeconds = 0.120;
54 const NSTimeInterval kHideFadeOutDurationSeconds = 0.200; 54 const NSTimeInterval kHideFadeOutDurationSeconds = 0.200;
55 55
56 // The minimum representable time interval. This can be used as the value 56 // The minimum representable time interval. This can be used as the value
57 // passed to +[NSAnimationContext setDuration:] to stop an in-progress 57 // passed to +[NSAnimationContext setDuration:] to stop an in-progress
58 // animation as quickly as possible. 58 // animation as quickly as possible.
59 const NSTimeInterval kMinimumTimeInterval = 59 const NSTimeInterval kMinimumTimeInterval =
60 std::numeric_limits<NSTimeInterval>::min(); 60 std::numeric_limits<NSTimeInterval>::min();
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 runAnimationGroup:^(NSAnimationContext* context) { 588 runAnimationGroup:^(NSAnimationContext* context) {
589 [context setDuration:duration]; 589 [context setDuration:duration];
590 [[window_ animator] setAlphaValue:alpha]; 590 [[window_ animator] setAlphaValue:alpha];
591 } 591 }
592 completionHandler:^{ 592 completionHandler:^{
593 if (weak_ptr) 593 if (weak_ptr)
594 weak_ptr->AnimationDidStop(); 594 weak_ptr->AnimationDidStop();
595 }]; 595 }];
596 } 596 }
597 597
598 void StatusBubbleMac::StartTimer(int64 delay_ms) { 598 void StatusBubbleMac::StartTimer(int64_t delay_ms) {
599 DCHECK([NSThread isMainThread]); 599 DCHECK([NSThread isMainThread]);
600 DCHECK(state_ == kBubbleShowingTimer || state_ == kBubbleHidingTimer); 600 DCHECK(state_ == kBubbleShowingTimer || state_ == kBubbleHidingTimer);
601 601
602 if (immediate_) { 602 if (immediate_) {
603 TimerFired(); 603 TimerFired();
604 return; 604 return;
605 } 605 }
606 606
607 // There can only be one running timer. 607 // There can only be one running timer.
608 CancelTimer(); 608 CancelTimer();
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 } 849 }
850 850
851 // Round the top corners when the bubble is below the parent window. 851 // Round the top corners when the bubble is below the parent window.
852 if (NSMinY(window_frame) < NSMinY(parent_frame)) { 852 if (NSMinY(window_frame) < NSMinY(parent_frame)) {
853 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; 853 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner;
854 } 854 }
855 } 855 }
856 856
857 return corner_flags; 857 return corner_flags;
858 } 858 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac.h ('k') | chrome/browser/ui/cocoa/status_icons/status_icon_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698