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" |
11 #include "base/mac/mac_util.h" | 11 #include "base/mac/mac_util.h" |
12 #include "base/mac/scoped_block.h" | 12 #include "base/mac/scoped_block.h" |
13 #include "base/mac/sdk_forward_declarations.h" | 13 #include "base/mac/sdk_forward_declarations.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/sys_string_conversions.h" | 16 #include "base/strings/sys_string_conversions.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #import "chrome/browser/ui/cocoa/bubble_view.h" | 18 #import "chrome/browser/ui/cocoa/bubble_view.h" |
19 #include "chrome/browser/ui/elide_url.h" | 19 #include "chrome/browser/ui/elide_url.h" |
20 #include "net/base/net_util.h" | 20 #include "net/base/net_util.h" |
21 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 21 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
22 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSBezierPath+RoundRect
.h" | 22 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSBezierPath+RoundRect
.h" |
23 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" | 23 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" |
24 #include "ui/base/cocoa/window_size_constants.h" | 24 #include "ui/base/cocoa/window_size_constants.h" |
25 #include "ui/gfx/font_list.h" | 25 #include "ui/gfx/font_list.h" |
26 #include "ui/gfx/point.h" | 26 #include "ui/gfx/geometry/point.h" |
27 #include "ui/gfx/text_elider.h" | 27 #include "ui/gfx/text_elider.h" |
28 #include "ui/gfx/text_utils.h" | 28 #include "ui/gfx/text_utils.h" |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 const int kWindowHeight = 18; | 32 const int kWindowHeight = 18; |
33 | 33 |
34 // The width of the bubble in relation to the width of the parent window. | 34 // The width of the bubble in relation to the width of the parent window. |
35 const CGFloat kWindowWidthPercent = 1.0 / 3.0; | 35 const CGFloat kWindowWidthPercent = 1.0 / 3.0; |
36 | 36 |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 } | 775 } |
776 | 776 |
777 // Round the top corners when the bubble is below the parent window. | 777 // Round the top corners when the bubble is below the parent window. |
778 if (NSMinY(window_frame) < NSMinY(parent_frame)) { | 778 if (NSMinY(window_frame) < NSMinY(parent_frame)) { |
779 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; | 779 corner_flags |= kRoundedTopLeftCorner | kRoundedTopRightCorner; |
780 } | 780 } |
781 } | 781 } |
782 | 782 |
783 return corner_flags; | 783 return corner_flags; |
784 } | 784 } |
OLD | NEW |