OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/infobar_container_delegate.h" | 5 #include "chrome/browser/ui/infobar_container_delegate.h" |
6 #include "ui/gfx/animation/slide_animation.h" | 6 #include "ui/gfx/animation/slide_animation.h" |
7 | 7 |
| 8 #if defined(TOOLKIT_VIEWS) |
| 9 #include "ui/views/window/non_client_view.h" |
| 10 #endif |
| 11 |
| 12 // static |
| 13 #if defined(TOOLKIT_VIEWS) |
| 14 // Views comes first since Mac may eventually be Views-based. |
| 15 const int InfoBarContainerDelegate::kSeparatorLineHeight = |
| 16 views::NonClientFrameView::kClientEdgeThickness; |
| 17 const int InfoBarContainerDelegate::kDefaultArrowTargetHeight = 9; |
| 18 #elif defined(OS_MACOSX) |
| 19 const int InfoBarContainerDelegate::kSeparatorLineHeight = 1; |
| 20 const int InfoBarContainerDelegate::kDefaultArrowTargetHeight = 11; |
| 21 #endif |
| 22 |
8 const int InfoBarContainerDelegate::kDefaultBarTargetHeight = 36; | 23 const int InfoBarContainerDelegate::kDefaultBarTargetHeight = 36; |
9 const int InfoBarContainerDelegate::kMaximumArrowTargetHeight = 24; | 24 const int InfoBarContainerDelegate::kMaximumArrowTargetHeight = 24; |
10 const int InfoBarContainerDelegate::kDefaultArrowTargetHalfWidth = | 25 const int InfoBarContainerDelegate::kDefaultArrowTargetHalfWidth = |
11 kDefaultArrowTargetHeight; | 26 kDefaultArrowTargetHeight; |
12 const int InfoBarContainerDelegate::kMaximumArrowTargetHalfWidth = 14; | 27 const int InfoBarContainerDelegate::kMaximumArrowTargetHalfWidth = 14; |
13 | 28 |
14 InfoBarContainerDelegate::InfoBarContainerDelegate() | 29 InfoBarContainerDelegate::InfoBarContainerDelegate() |
15 : top_arrow_target_height_(kDefaultArrowTargetHeight) { | 30 : top_arrow_target_height_(kDefaultArrowTargetHeight) { |
16 } | 31 } |
17 | 32 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // this, changing the arrow height from 0 to kSeparatorLineHeight would | 91 // this, changing the arrow height from 0 to kSeparatorLineHeight would |
77 // produce no visible effect, because the stroke would paint atop the divider | 92 // produce no visible effect, because the stroke would paint atop the divider |
78 // line above the infobar. | 93 // line above the infobar. |
79 if (*arrow_height) | 94 if (*arrow_height) |
80 *arrow_height += kSeparatorLineHeight; | 95 *arrow_height += kSeparatorLineHeight; |
81 | 96 |
82 *bar_height = animation.CurrentValueBetween( | 97 *bar_height = animation.CurrentValueBetween( |
83 0, | 98 0, |
84 (bar_target_height == -1) ? kDefaultBarTargetHeight : bar_target_height); | 99 (bar_target_height == -1) ? kDefaultBarTargetHeight : bar_target_height); |
85 } | 100 } |
OLD | NEW |