Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Side by Side Diff: components/infobars/core/infobar_container.cc

Issue 240193003: Move Infobars core files to the Infobars component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nib name on mac Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/infobars/core/infobar_container.h ('k') | components/infobars/core/infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698