| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/infobars/confirm_infobar.h" | 5 #include "chrome/browser/ui/views/infobars/confirm_infobar.h" |
| 6 | 6 |
| 7 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 7 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 8 #include "chrome/browser/ui/views/event_utils.h" | 8 #include "chrome/browser/ui/views/event_utils.h" |
| 9 #include "views/controls/button/text_button.h" | 9 #include "views/controls/button/text_button.h" |
| 10 #include "views/controls/label.h" | 10 #include "views/controls/label.h" |
| 11 #include "views/controls/link.h" | 11 #include "views/controls/link.h" |
| 12 | 12 |
| 13 // ConfirmInfoBarDelegate ----------------------------------------------------- | 13 // ConfirmInfoBarDelegate ----------------------------------------------------- |
| 14 | 14 |
| 15 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { | 15 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { |
| 16 return new ConfirmInfoBar(this); | 16 return new ConfirmInfoBar(owner, this); |
| 17 } | 17 } |
| 18 | 18 |
| 19 // ConfirmInfoBar ------------------------------------------------------------- | 19 // ConfirmInfoBar ------------------------------------------------------------- |
| 20 | 20 |
| 21 ConfirmInfoBar::ConfirmInfoBar(ConfirmInfoBarDelegate* delegate) | 21 ConfirmInfoBar::ConfirmInfoBar(TabContentsWrapper* owner, |
| 22 : InfoBarView(delegate), | 22 ConfirmInfoBarDelegate* delegate) |
| 23 : InfoBarView(owner, delegate), |
| 23 label_(NULL), | 24 label_(NULL), |
| 24 ok_button_(NULL), | 25 ok_button_(NULL), |
| 25 cancel_button_(NULL), | 26 cancel_button_(NULL), |
| 26 link_(NULL) { | 27 link_(NULL) { |
| 27 } | 28 } |
| 28 | 29 |
| 29 ConfirmInfoBar::~ConfirmInfoBar() { | 30 ConfirmInfoBar::~ConfirmInfoBar() { |
| 30 } | 31 } |
| 31 | 32 |
| 32 void ConfirmInfoBar::Layout() { | 33 void ConfirmInfoBar::Layout() { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 DCHECK(link_ != NULL); | 124 DCHECK(link_ != NULL); |
| 124 DCHECK_EQ(link_, source); | 125 DCHECK_EQ(link_, source); |
| 125 if (GetDelegate()->LinkClicked( | 126 if (GetDelegate()->LinkClicked( |
| 126 event_utils::DispositionFromEventFlags(event_flags))) | 127 event_utils::DispositionFromEventFlags(event_flags))) |
| 127 RemoveInfoBar(); | 128 RemoveInfoBar(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { | 131 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { |
| 131 return delegate()->AsConfirmInfoBarDelegate(); | 132 return delegate()->AsConfirmInfoBarDelegate(); |
| 132 } | 133 } |
| OLD | NEW |