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 "build/build_config.h" |
6 | 6 |
7 // TODO(pkasting): Port Mac to use this. | 7 // TODO(pkasting): Port Mac to use this. |
8 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) | 8 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) |
9 | 9 |
10 #include "chrome/browser/infobars/infobar_container.h" | 10 #include "chrome/browser/infobars/infobar_container.h" |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "chrome/browser/api/infobars/infobar_delegate.h" |
15 #include "chrome/browser/infobars/infobar.h" | 16 #include "chrome/browser/infobars/infobar.h" |
16 #include "chrome/browser/infobars/infobar_delegate.h" | |
17 #include "chrome/browser/infobars/infobar_tab_helper.h" | 17 #include "chrome/browser/infobars/infobar_tab_helper.h" |
18 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
19 #include "content/public/browser/notification_details.h" | 19 #include "content/public/browser/notification_details.h" |
20 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
21 #include "ui/base/animation/slide_animation.h" | 21 #include "ui/base/animation/slide_animation.h" |
22 | 22 |
23 InfoBarContainer::Delegate::~Delegate() { | 23 InfoBarContainer::Delegate::~Delegate() { |
24 } | 24 } |
25 | 25 |
26 InfoBarContainer::InfoBarContainer(Delegate* delegate) | 26 InfoBarContainer::InfoBarContainer(Delegate* delegate) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 return InfoBar::kDefaultArrowTargetHeight; | 211 return InfoBar::kDefaultArrowTargetHeight; |
212 // When the first infobar is animating closed, we animate the second infobar's | 212 // When the first infobar is animating closed, we animate the second infobar's |
213 // arrow target height from the default to the top target height. Note that | 213 // arrow target height from the default to the top target height. Note that |
214 // the animation values here are going from 1.0 -> 0.0 as the top bar closes. | 214 // the animation values here are going from 1.0 -> 0.0 as the top bar closes. |
215 return top_arrow_target_height_ + static_cast<int>( | 215 return top_arrow_target_height_ + static_cast<int>( |
216 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * | 216 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * |
217 first_infobar_animation.GetCurrentValue()); | 217 first_infobar_animation.GetCurrentValue()); |
218 } | 218 } |
219 | 219 |
220 #endif // TOOLKIT_VIEWS || defined(TOOLKIT_GTK) | 220 #endif // TOOLKIT_VIEWS || defined(TOOLKIT_GTK) |
OLD | NEW |