| 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 |
| 15 namespace infobars { |
| 16 |
| 16 InfoBarContainer::Delegate::~Delegate() { | 17 InfoBarContainer::Delegate::~Delegate() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 InfoBarContainer::InfoBarContainer(Delegate* delegate) | 20 InfoBarContainer::InfoBarContainer(Delegate* delegate) |
| 20 : delegate_(delegate), | 21 : delegate_(delegate), |
| 21 infobar_manager_(NULL), | 22 infobar_manager_(NULL), |
| 22 top_arrow_target_height_(InfoBar::kDefaultArrowTargetHeight) { | 23 top_arrow_target_height_(InfoBar::kDefaultArrowTargetHeight) { |
| 23 } | 24 } |
| 24 | 25 |
| 25 InfoBarContainer::~InfoBarContainer() { | 26 InfoBarContainer::~InfoBarContainer() { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 const_cast<const InfoBar*>(infobars_.front())->animation(); | 167 const_cast<const InfoBar*>(infobars_.front())->animation(); |
| 167 if ((infobar_index > 1) || first_infobar_animation.IsShowing()) | 168 if ((infobar_index > 1) || first_infobar_animation.IsShowing()) |
| 168 return InfoBar::kDefaultArrowTargetHeight; | 169 return InfoBar::kDefaultArrowTargetHeight; |
| 169 // When the first infobar is animating closed, we animate the second infobar's | 170 // 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 | 171 // 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. | 172 // 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>( | 173 return top_arrow_target_height_ + static_cast<int>( |
| 173 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * | 174 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * |
| 174 first_infobar_animation.GetCurrentValue()); | 175 first_infobar_animation.GetCurrentValue()); |
| 175 } | 176 } |
| 177 |
| 178 } // namespace infobars |
| OLD | NEW |