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 "build/build_config.h" | 5 #include "components/infobars/core/infobar_container.h" |
6 | |
7 #include "chrome/browser/infobars/infobar_container.h" | |
8 | 6 |
9 #include <algorithm> | 7 #include <algorithm> |
10 | 8 |
11 #include "base/logging.h" | 9 #include "base/logging.h" |
12 #include "chrome/browser/infobars/infobar.h" | 10 #include "build/build_config.h" |
13 #include "chrome/browser/infobars/infobar_delegate.h" | 11 #include "components/infobars/core/infobar.h" |
| 12 #include "components/infobars/core/infobar_delegate.h" |
14 #include "ui/gfx/animation/slide_animation.h" | 13 #include "ui/gfx/animation/slide_animation.h" |
15 | 14 |
16 InfoBarContainer::Delegate::~Delegate() { | 15 InfoBarContainer::Delegate::~Delegate() { |
17 } | 16 } |
18 | 17 |
19 InfoBarContainer::InfoBarContainer(Delegate* delegate) | 18 InfoBarContainer::InfoBarContainer(Delegate* delegate) |
20 : delegate_(delegate), | 19 : delegate_(delegate), |
21 infobar_manager_(NULL), | 20 infobar_manager_(NULL), |
22 top_arrow_target_height_(InfoBar::kDefaultArrowTargetHeight) { | 21 top_arrow_target_height_(InfoBar::kDefaultArrowTargetHeight) { |
23 } | 22 } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 const_cast<const InfoBar*>(infobars_.front())->animation(); | 165 const_cast<const InfoBar*>(infobars_.front())->animation(); |
167 if ((infobar_index > 1) || first_infobar_animation.IsShowing()) | 166 if ((infobar_index > 1) || first_infobar_animation.IsShowing()) |
168 return InfoBar::kDefaultArrowTargetHeight; | 167 return InfoBar::kDefaultArrowTargetHeight; |
169 // When the first infobar is animating closed, we animate the second infobar's | 168 // When the first infobar is animating closed, we animate the second infobar's |
170 // arrow target height from the default to the top target height. Note that | 169 // arrow target height from the default to the top target height. Note that |
171 // the animation values here are going from 1.0 -> 0.0 as the top bar closes. | 170 // the animation values here are going from 1.0 -> 0.0 as the top bar closes. |
172 return top_arrow_target_height_ + static_cast<int>( | 171 return top_arrow_target_height_ + static_cast<int>( |
173 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * | 172 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * |
174 first_infobar_animation.GetCurrentValue()); | 173 first_infobar_animation.GetCurrentValue()); |
175 } | 174 } |
OLD | NEW |