| 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/chrome_canvas.h" | 7 #include "app/gfx/chrome_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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 private: | 77 private: |
| 78 scoped_ptr<views::Background> gradient_background_; | 78 scoped_ptr<views::Background> gradient_background_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(InfoBarBackground); | 80 DISALLOW_COPY_AND_ASSIGN(InfoBarBackground); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // InfoBar, public: ------------------------------------------------------------ | 83 // InfoBar, public: ------------------------------------------------------------ |
| 84 | 84 |
| 85 InfoBar::InfoBar(InfoBarDelegate* delegate) | 85 InfoBar::InfoBar(InfoBarDelegate* delegate) |
| 86 : delegate_(delegate), | 86 : delegate_(delegate), |
| 87 close_button_(new views::ImageButton(this)), | 87 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 88 delete_factory_(this) { | 88 close_button_(new views::ImageButton(this))), |
| 89 ALLOW_THIS_IN_INITIALIZER_LIST(delete_factory_(this)) { |
| 89 // We delete ourselves when we're removed from the view hierarchy. | 90 // We delete ourselves when we're removed from the view hierarchy. |
| 90 SetParentOwned(false); | 91 SetParentOwned(false); |
| 91 | 92 |
| 92 set_background(new InfoBarBackground); | 93 set_background(new InfoBarBackground); |
| 93 | 94 |
| 94 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 95 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 95 close_button_->SetImage(views::CustomButton::BS_NORMAL, | 96 close_button_->SetImage(views::CustomButton::BS_NORMAL, |
| 96 rb.GetBitmapNamed(IDR_CLOSE_BAR)); | 97 rb.GetBitmapNamed(IDR_CLOSE_BAR)); |
| 97 close_button_->SetImage(views::CustomButton::BS_HOT, | 98 close_button_->SetImage(views::CustomButton::BS_HOT, |
| 98 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); | 99 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 | 483 |
| 483 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { | 484 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { |
| 484 return new LinkInfoBar(this); | 485 return new LinkInfoBar(this); |
| 485 } | 486 } |
| 486 | 487 |
| 487 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- | 488 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- |
| 488 | 489 |
| 489 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 490 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { |
| 490 return new ConfirmInfoBar(this); | 491 return new ConfirmInfoBar(this); |
| 491 } | 492 } |
| OLD | NEW |