| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "app/slide_animation.h" | 10 #include "app/slide_animation.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 void InfoBar::InfoBarAdded() { | 201 void InfoBar::InfoBarAdded() { |
| 202 // The container_ pointer must be set before adding to the view hierarchy. | 202 // The container_ pointer must be set before adding to the view hierarchy. |
| 203 DCHECK(container_); | 203 DCHECK(container_); |
| 204 #if defined(OS_WIN) | 204 #if defined(OS_WIN) |
| 205 // When we're added to a view hierarchy within a widget, we create an | 205 // When we're added to a view hierarchy within a widget, we create an |
| 206 // external focus tracker to track what was focused in case we obtain | 206 // external focus tracker to track what was focused in case we obtain |
| 207 // focus so that we can restore focus when we're removed. | 207 // focus so that we can restore focus when we're removed. |
| 208 views::Widget* widget = GetWidget(); | 208 views::Widget* widget = GetWidget(); |
| 209 if (widget) { | 209 if (widget) { |
| 210 focus_tracker_.reset(new views::ExternalFocusTracker(this, | 210 focus_tracker_.reset( |
| 211 GetFocusManager())); | 211 new views::ExternalFocusTracker(this, |
| 212 views::FocusManager::GetFocusManager(widget->GetNativeView()))); |
| 212 } | 213 } |
| 213 #endif | 214 #endif |
| 214 } | 215 } |
| 215 | 216 |
| 216 void InfoBar::InfoBarRemoved() { | 217 void InfoBar::InfoBarRemoved() { |
| 217 DestroyFocusTracker(false); | 218 DestroyFocusTracker(false); |
| 218 // NULL our container_ pointer so that if Animation::Stop results in | 219 // NULL our container_ pointer so that if Animation::Stop results in |
| 219 // AnimationEnded being called, we do not try and delete ourselves twice. | 220 // AnimationEnded being called, we do not try and delete ourselves twice. |
| 220 container_ = NULL; | 221 container_ = NULL; |
| 221 animation_->Stop(); | 222 animation_->Stop(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 | 485 |
| 485 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { | 486 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { |
| 486 return new LinkInfoBar(this); | 487 return new LinkInfoBar(this); |
| 487 } | 488 } |
| 488 | 489 |
| 489 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- | 490 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- |
| 490 | 491 |
| 491 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 492 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { |
| 492 return new ConfirmInfoBar(this); | 493 return new ConfirmInfoBar(this); |
| 493 } | 494 } |
| OLD | NEW |