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/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/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #import "chrome/browser/ui/cocoa/bubble_view.h" | 14 #import "chrome/browser/ui/cocoa/bubble_view.h" |
15 #include "gfx/point.h" | |
16 #include "net/base/net_util.h" | 15 #include "net/base/net_util.h" |
17 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 16 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
18 #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" | 17 #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" |
19 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" | 18 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" |
20 #include "ui/base/text/text_elider.h" | 19 #include "ui/base/text/text_elider.h" |
| 20 #include "ui/gfx/point.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 const int kWindowHeight = 18; | 24 const int kWindowHeight = 18; |
25 | 25 |
26 // The width of the bubble in relation to the width of the parent window. | 26 // The width of the bubble in relation to the width of the parent window. |
27 const CGFloat kWindowWidthPercent = 1.0 / 3.0; | 27 const CGFloat kWindowWidthPercent = 1.0 / 3.0; |
28 | 28 |
29 // How close the mouse can get to the infobubble before it starts sliding | 29 // How close the mouse can get to the infobubble before it starts sliding |
30 // off-screen. | 30 // off-screen. |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 | 696 |
697 if (expanded_width) { | 697 if (expanded_width) { |
698 size.width = screenRect.size.width; | 698 size.width = screenRect.size.width; |
699 } else { | 699 } else { |
700 size.width = kWindowWidthPercent * screenRect.size.width; | 700 size.width = kWindowWidthPercent * screenRect.size.width; |
701 } | 701 } |
702 | 702 |
703 screenRect.size = size; | 703 screenRect.size = size; |
704 return screenRect; | 704 return screenRect; |
705 } | 705 } |
OLD | NEW |