| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 void InfoBar::InfoBarAdded() { | 197 void InfoBar::InfoBarAdded() { |
| 198 // The container_ pointer must be set before adding to the view hierarchy. | 198 // The container_ pointer must be set before adding to the view hierarchy. |
| 199 DCHECK(container_); | 199 DCHECK(container_); |
| 200 #if defined(OS_WIN) | 200 #if defined(OS_WIN) |
| 201 // When we're added to a view hierarchy within a widget, we create an | 201 // When we're added to a view hierarchy within a widget, we create an |
| 202 // external focus tracker to track what was focused in case we obtain | 202 // external focus tracker to track what was focused in case we obtain |
| 203 // focus so that we can restore focus when we're removed. | 203 // focus so that we can restore focus when we're removed. |
| 204 views::Widget* widget = GetWidget(); | 204 views::Widget* widget = GetWidget(); |
| 205 if (widget) { | 205 if (widget) { |
| 206 focus_tracker_.reset( | 206 focus_tracker_.reset(new views::ExternalFocusTracker(this, |
| 207 new views::ExternalFocusTracker(this, | 207 GetFocusManager())); |
| 208 views::FocusManager::GetFocusManager(widget->GetNativeView()))); | |
| 209 } | 208 } |
| 210 #endif | 209 #endif |
| 211 } | 210 } |
| 212 | 211 |
| 213 void InfoBar::InfoBarRemoved() { | 212 void InfoBar::InfoBarRemoved() { |
| 214 DestroyFocusTracker(false); | 213 DestroyFocusTracker(false); |
| 215 // NULL our container_ pointer so that if Animation::Stop results in | 214 // NULL our container_ pointer so that if Animation::Stop results in |
| 216 // AnimationEnded being called, we do not try and delete ourselves twice. | 215 // AnimationEnded being called, we do not try and delete ourselves twice. |
| 217 container_ = NULL; | 216 container_ = NULL; |
| 218 animation_->Stop(); | 217 animation_->Stop(); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 | 480 |
| 482 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { | 481 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { |
| 483 return new LinkInfoBar(this); | 482 return new LinkInfoBar(this); |
| 484 } | 483 } |
| 485 | 484 |
| 486 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- | 485 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- |
| 487 | 486 |
| 488 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 487 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { |
| 489 return new ConfirmInfoBar(this); | 488 return new ConfirmInfoBar(this); |
| 490 } | 489 } |
| OLD | NEW |