OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" | 8 #include "chrome/browser/api/infobars/confirm_infobar_delegate.h" |
9 #include "chrome/browser/event_disposition.h" | 9 #include "chrome/browser/event_disposition.h" |
10 #include "chrome/browser/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
11 #include "ui/views/controls/button/text_button.h" | 11 #include "ui/views/controls/button/text_button.h" |
12 #include "ui/views/controls/label.h" | 12 #include "ui/views/controls/label.h" |
13 #include "ui/views/controls/link.h" | 13 #include "ui/views/controls/link.h" |
14 | 14 |
15 // ConfirmInfoBarDelegate ----------------------------------------------------- | 15 // ConfirmInfoBarDelegate ----------------------------------------------------- |
16 | 16 |
17 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) { | 17 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar(InfoBarService* owner) { |
18 return new ConfirmInfoBar(static_cast<InfoBarTabHelper*>(owner), this); | 18 return new ConfirmInfoBar(static_cast<InfoBarTabHelper*>(owner), this); |
19 } | 19 } |
20 | 20 |
21 // ConfirmInfoBar ------------------------------------------------------------- | 21 // ConfirmInfoBar ------------------------------------------------------------- |
22 | 22 |
23 ConfirmInfoBar::ConfirmInfoBar(InfoBarTabHelper* owner, | 23 ConfirmInfoBar::ConfirmInfoBar(InfoBarTabHelper* owner, |
24 ConfirmInfoBarDelegate* delegate) | 24 ConfirmInfoBarDelegate* delegate) |
25 : InfoBarView(owner, delegate), | 25 : InfoBarView(owner, delegate), |
26 label_(NULL), | 26 label_(NULL), |
27 ok_button_(NULL), | 27 ok_button_(NULL), |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 DCHECK(link_ != NULL); | 130 DCHECK(link_ != NULL); |
131 DCHECK_EQ(link_, source); | 131 DCHECK_EQ(link_, source); |
132 if (GetDelegate()->LinkClicked( | 132 if (GetDelegate()->LinkClicked( |
133 chrome::DispositionFromEventFlags(event_flags))) | 133 chrome::DispositionFromEventFlags(event_flags))) |
134 RemoveSelf(); | 134 RemoveSelf(); |
135 } | 135 } |
136 | 136 |
137 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { | 137 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { |
138 return delegate()->AsConfirmInfoBarDelegate(); | 138 return delegate()->AsConfirmInfoBarDelegate(); |
139 } | 139 } |
OLD | NEW |