| 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) | 8 #if defined(TOOLKIT_VIEWS) |
| 9 #include "ui/views/window/non_client_view.h" | 9 #include "ui/views/window/non_client_view.h" |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 #if defined(TOOLKIT_VIEWS) | 13 #if defined(OS_MACOSX) |
| 14 // Views comes first since Mac may eventually be Views-based. | 14 const int InfoBarContainerDelegate::kSeparatorLineHeight = 1; |
| 15 const int InfoBarContainerDelegate::kDefaultArrowTargetHeight = 11; |
| 16 #elif defined(TOOLKIT_VIEWS) |
| 17 // Views comes second until the Mac browser is Views-based. |
| 15 const int InfoBarContainerDelegate::kSeparatorLineHeight = | 18 const int InfoBarContainerDelegate::kSeparatorLineHeight = |
| 16 views::NonClientFrameView::kClientEdgeThickness; | 19 views::NonClientFrameView::kClientEdgeThickness; |
| 17 const int InfoBarContainerDelegate::kDefaultArrowTargetHeight = 9; | 20 const int InfoBarContainerDelegate::kDefaultArrowTargetHeight = 9; |
| 18 #elif defined(OS_MACOSX) | |
| 19 const int InfoBarContainerDelegate::kSeparatorLineHeight = 1; | |
| 20 const int InfoBarContainerDelegate::kDefaultArrowTargetHeight = 11; | |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 const int InfoBarContainerDelegate::kDefaultBarTargetHeight = 36; | 23 const int InfoBarContainerDelegate::kDefaultBarTargetHeight = 36; |
| 24 const int InfoBarContainerDelegate::kMaximumArrowTargetHeight = 24; | 24 const int InfoBarContainerDelegate::kMaximumArrowTargetHeight = 24; |
| 25 const int InfoBarContainerDelegate::kDefaultArrowTargetHalfWidth = | 25 const int InfoBarContainerDelegate::kDefaultArrowTargetHalfWidth = |
| 26 kDefaultArrowTargetHeight; | 26 kDefaultArrowTargetHeight; |
| 27 const int InfoBarContainerDelegate::kMaximumArrowTargetHalfWidth = 14; | 27 const int InfoBarContainerDelegate::kMaximumArrowTargetHalfWidth = 14; |
| 28 | 28 |
| 29 InfoBarContainerDelegate::InfoBarContainerDelegate() | 29 InfoBarContainerDelegate::InfoBarContainerDelegate() |
| 30 : top_arrow_target_height_(kDefaultArrowTargetHeight) { | 30 : top_arrow_target_height_(kDefaultArrowTargetHeight) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // this, changing the arrow height from 0 to kSeparatorLineHeight would | 91 // this, changing the arrow height from 0 to kSeparatorLineHeight would |
| 92 // 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 |
| 93 // line above the infobar. | 93 // line above the infobar. |
| 94 if (*arrow_height) | 94 if (*arrow_height) |
| 95 *arrow_height += kSeparatorLineHeight; | 95 *arrow_height += kSeparatorLineHeight; |
| 96 | 96 |
| 97 *bar_height = animation.CurrentValueBetween( | 97 *bar_height = animation.CurrentValueBetween( |
| 98 0, | 98 0, |
| 99 (bar_target_height == -1) ? kDefaultBarTargetHeight : bar_target_height); | 99 (bar_target_height == -1) ? kDefaultBarTargetHeight : bar_target_height); |
| 100 } | 100 } |
| OLD | NEW |