| 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. | |
| 8 #if defined(TOOLKIT_VIEWS) || defined(TOOLKIT_GTK) || defined(OS_ANDROID) | |
| 9 | |
| 10 #include "chrome/browser/infobars/infobar_container.h" | 7 #include "chrome/browser/infobars/infobar_container.h" |
| 11 | 8 |
| 12 #include <algorithm> | 9 #include <algorithm> |
| 13 | 10 |
| 14 #include "base/logging.h" | 11 #include "base/logging.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/infobars/infobar.h" | 13 #include "chrome/browser/infobars/infobar.h" |
| 17 #include "chrome/browser/infobars/infobar_delegate.h" | 14 #include "chrome/browser/infobars/infobar_delegate.h" |
| 18 #include "chrome/browser/infobars/infobar_service.h" | 15 #include "chrome/browser/infobars/infobar_service.h" |
| 19 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 const_cast<const InfoBar*>(infobars_.front())->animation(); | 225 const_cast<const InfoBar*>(infobars_.front())->animation(); |
| 229 if ((infobar_index > 1) || first_infobar_animation.IsShowing()) | 226 if ((infobar_index > 1) || first_infobar_animation.IsShowing()) |
| 230 return InfoBar::kDefaultArrowTargetHeight; | 227 return InfoBar::kDefaultArrowTargetHeight; |
| 231 // When the first infobar is animating closed, we animate the second infobar's | 228 // When the first infobar is animating closed, we animate the second infobar's |
| 232 // arrow target height from the default to the top target height. Note that | 229 // arrow target height from the default to the top target height. Note that |
| 233 // the animation values here are going from 1.0 -> 0.0 as the top bar closes. | 230 // the animation values here are going from 1.0 -> 0.0 as the top bar closes. |
| 234 return top_arrow_target_height_ + static_cast<int>( | 231 return top_arrow_target_height_ + static_cast<int>( |
| 235 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * | 232 (InfoBar::kDefaultArrowTargetHeight - top_arrow_target_height_) * |
| 236 first_infobar_animation.GetCurrentValue()); | 233 first_infobar_animation.GetCurrentValue()); |
| 237 } | 234 } |
| 238 | |
| 239 #endif // TOOLKIT_VIEWS || defined(TOOLKIT_GTK) || defined(OS_ANDROID) | |
| OLD | NEW |