| 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 "ash/frame/header_painter_util.h" | 5 #include "ash/frame/header_painter_util.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/compositor/layer.h" | 10 #include "ui/compositor/layer.h" |
| 11 #include "ui/compositor/layer_animator.h" | 11 #include "ui/compositor/layer_animator.h" |
| 12 #include "ui/gfx/font_list.h" | 12 #include "ui/gfx/font_list.h" |
| 13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 14 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
| 15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // Radius of the header's top corners when the window is restored. | 19 // Radius of the header's top corners when the window is restored. |
| 20 const int kTopCornerRadiusWhenRestored = 2; | 20 const int kTopCornerRadiusWhenRestored = 2; |
| 21 | 21 |
| 22 // Distance between left edge of the window and the header icon. | 22 // Distance between left edge of the window and the header icon. |
| 23 const int kIconXOffset = 9; | 23 const int kIconXOffset = 9; |
| 24 | 24 |
| 25 // Height and width of header icon. | 25 // Default height and width of header icon. |
| 26 const int kIconSize = 16; | 26 const int kDefaultIconSize = 16; |
| 27 | 27 |
| 28 // Space between the title text and the caption buttons. | 28 // Space between the title text and the caption buttons. |
| 29 const int kTitleCaptionButtonSpacing = 5; | 29 const int kTitleCaptionButtonSpacing = 5; |
| 30 | 30 |
| 31 // Space between window icon and title text. | 31 // Space between window icon and title text. |
| 32 const int kTitleIconOffsetX = 5; | 32 const int kTitleIconOffsetX = 5; |
| 33 | 33 |
| 34 // Space between window edge and title text, when there is no icon. | 34 // Space between window edge and title text, when there is no icon. |
| 35 const int kTitleNoIconOffsetX = 8; | 35 const int kTitleNoIconOffsetX = 8; |
| 36 | 36 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 50 int HeaderPainterUtil::GetTopCornerRadiusWhenRestored() { | 50 int HeaderPainterUtil::GetTopCornerRadiusWhenRestored() { |
| 51 return kTopCornerRadiusWhenRestored; | 51 return kTopCornerRadiusWhenRestored; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 int HeaderPainterUtil::GetIconXOffset() { | 55 int HeaderPainterUtil::GetIconXOffset() { |
| 56 return kIconXOffset; | 56 return kIconXOffset; |
| 57 } | 57 } |
| 58 | 58 |
| 59 // static | 59 // static |
| 60 int HeaderPainterUtil::GetIconSize() { | 60 int HeaderPainterUtil::GetDefaultIconSize() { |
| 61 return kIconSize; | 61 return kDefaultIconSize; |
| 62 } | 62 } |
| 63 | 63 |
| 64 // static | 64 // static |
| 65 int HeaderPainterUtil::GetThemeBackgroundXInset() { | 65 int HeaderPainterUtil::GetThemeBackgroundXInset() { |
| 66 return kThemeFrameImageInsetX; | 66 return kThemeFrameImageInsetX; |
| 67 } | 67 } |
| 68 | 68 |
| 69 // static | 69 // static |
| 70 gfx::Rect HeaderPainterUtil::GetTitleBounds( | 70 gfx::Rect HeaderPainterUtil::GetTitleBounds( |
| 71 const views::View* icon, | 71 const views::View* icon, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 ui::LayerAnimator* parent_layer_animator = | 98 ui::LayerAnimator* parent_layer_animator = |
| 99 window->parent()->layer()->GetAnimator(); | 99 window->parent()->layer()->GetAnimator(); |
| 100 return !parent_layer_animator->IsAnimatingProperty( | 100 return !parent_layer_animator->IsAnimatingProperty( |
| 101 ui::LayerAnimationElement::OPACITY) && | 101 ui::LayerAnimationElement::OPACITY) && |
| 102 !parent_layer_animator->IsAnimatingProperty( | 102 !parent_layer_animator->IsAnimatingProperty( |
| 103 ui::LayerAnimationElement::VISIBILITY); | 103 ui::LayerAnimationElement::VISIBILITY); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace ash | 106 } // namespace ash |
| OLD | NEW |