| 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/link_infobar.h" | 5 #include "chrome/browser/ui/views/infobars/link_infobar.h" |
| 6 | 6 |
| 7 #include "chrome/browser/event_disposition.h" |
| 7 #include "chrome/browser/tab_contents/link_infobar_delegate.h" | 8 #include "chrome/browser/tab_contents/link_infobar_delegate.h" |
| 8 #include "chrome/browser/ui/views/event_utils.h" | |
| 9 #include "views/controls/label.h" | 9 #include "views/controls/label.h" |
| 10 #include "views/controls/link.h" | 10 #include "views/controls/link.h" |
| 11 | 11 |
| 12 // LinkInfoBarDelegate -------------------------------------------------------- | 12 // LinkInfoBarDelegate -------------------------------------------------------- |
| 13 | 13 |
| 14 InfoBar* LinkInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { | 14 InfoBar* LinkInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { |
| 15 return new LinkInfoBar(owner, this); | 15 return new LinkInfoBar(owner, this); |
| 16 } | 16 } |
| 17 | 17 |
| 18 // LinkInfoBar ---------------------------------------------------------------- | 18 // LinkInfoBar ---------------------------------------------------------------- |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 // This must happen after adding all other children so InfoBarView can ensure | 69 // This must happen after adding all other children so InfoBarView can ensure |
| 70 // the close button is the last child. | 70 // the close button is the last child. |
| 71 InfoBarView::ViewHierarchyChanged(is_add, parent, child); | 71 InfoBarView::ViewHierarchyChanged(is_add, parent, child); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void LinkInfoBar::LinkClicked(views::Link* source, int event_flags) { | 74 void LinkInfoBar::LinkClicked(views::Link* source, int event_flags) { |
| 75 DCHECK(link_ != NULL); | 75 DCHECK(link_ != NULL); |
| 76 DCHECK_EQ(link_, source); | 76 DCHECK_EQ(link_, source); |
| 77 if (GetDelegate()->LinkClicked( | 77 if (GetDelegate()->LinkClicked( |
| 78 event_utils::DispositionFromEventFlags(event_flags))) | 78 browser::DispositionFromEventFlags(event_flags))) |
| 79 RemoveInfoBar(); | 79 RemoveInfoBar(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 LinkInfoBarDelegate* LinkInfoBar::GetDelegate() { | 82 LinkInfoBarDelegate* LinkInfoBar::GetDelegate() { |
| 83 return delegate()->AsLinkInfoBarDelegate(); | 83 return delegate()->AsLinkInfoBarDelegate(); |
| 84 } | 84 } |
| OLD | NEW |