| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/views/infobars/infobars.h" | 5 #include "chrome/browser/views/infobars/infobars.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "app/slide_animation.h" | 9 #include "app/slide_animation.h" |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 InfoBar::~InfoBar() { | 142 InfoBar::~InfoBar() { |
| 143 } | 143 } |
| 144 | 144 |
| 145 void InfoBar::AnimateOpen() { | 145 void InfoBar::AnimateOpen() { |
| 146 animation_->Show(); | 146 animation_->Show(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void InfoBar::Open() { | 149 void InfoBar::Open() { |
| 150 // Set the animation value to 1.0 so that GetPreferredSize() returns the right |
| 151 // size. |
| 150 animation_->Reset(1.0); | 152 animation_->Reset(1.0); |
| 151 animation_->Show(); | 153 if (container_) |
| 154 container_->InfoBarAnimated(false); |
| 152 } | 155 } |
| 153 | 156 |
| 154 void InfoBar::AnimateClose() { | 157 void InfoBar::AnimateClose() { |
| 155 bool restore_focus = true; | 158 bool restore_focus = true; |
| 156 #if defined(OS_WIN) | 159 #if defined(OS_WIN) |
| 157 // Do not restore focus (and active state with it) on Windows if some other | 160 // Do not restore focus (and active state with it) on Windows if some other |
| 158 // top-level window became active. | 161 // top-level window became active. |
| 159 if (GetWidget() && | 162 if (GetWidget() && |
| 160 !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) { | 163 !win_util::DoesWindowBelongToActiveWindow(GetWidget()->GetNativeView())) { |
| 161 restore_focus = false; | 164 restore_focus = false; |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 | 594 |
| 592 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { | 595 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { |
| 593 return new LinkInfoBar(this); | 596 return new LinkInfoBar(this); |
| 594 } | 597 } |
| 595 | 598 |
| 596 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- | 599 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- |
| 597 | 600 |
| 598 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 601 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { |
| 599 return new ConfirmInfoBar(this); | 602 return new ConfirmInfoBar(this); |
| 600 } | 603 } |
| OLD | NEW |