Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: chrome/browser/ui/views/infobars/link_infobar.cc

Issue 10830353: Introduce InfoBarTabService API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments, merge to LKGR Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/link_infobar.h" 5 #include "chrome/browser/ui/views/infobars/link_infobar.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/api/infobars/link_infobar_delegate.h" 8 #include "chrome/browser/api/infobars/link_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 "ui/views/controls/label.h" 11 #include "ui/views/controls/label.h"
11 #include "ui/views/controls/link.h" 12 #include "ui/views/controls/link.h"
12 13
13 // LinkInfoBarDelegate -------------------------------------------------------- 14 // LinkInfoBarDelegate --------------------------------------------------------
14 15
15 InfoBar* LinkInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { 16 InfoBar* LinkInfoBarDelegate::CreateInfoBar(InfoBarTabService* owner) {
16 return new LinkInfoBar(owner, this); 17 return new LinkInfoBar(static_cast<InfoBarTabHelper*>(owner), this);
17 } 18 }
18 19
19 // LinkInfoBar ---------------------------------------------------------------- 20 // LinkInfoBar ----------------------------------------------------------------
20 21
21 LinkInfoBar::LinkInfoBar(InfoBarTabHelper* owner, 22 LinkInfoBar::LinkInfoBar(InfoBarTabHelper* owner,
22 LinkInfoBarDelegate* delegate) 23 LinkInfoBarDelegate* delegate)
23 : InfoBarView(owner, delegate), 24 : InfoBarView(owner, delegate),
24 label_1_(NULL), 25 label_1_(NULL),
25 link_(NULL), 26 link_(NULL),
26 label_2_(NULL) { 27 label_2_(NULL) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 DCHECK(link_ != NULL); 78 DCHECK(link_ != NULL);
78 DCHECK_EQ(link_, source); 79 DCHECK_EQ(link_, source);
79 if (GetDelegate()->LinkClicked( 80 if (GetDelegate()->LinkClicked(
80 chrome::DispositionFromEventFlags(event_flags))) 81 chrome::DispositionFromEventFlags(event_flags)))
81 RemoveSelf(); 82 RemoveSelf();
82 } 83 }
83 84
84 LinkInfoBarDelegate* LinkInfoBar::GetDelegate() { 85 LinkInfoBarDelegate* LinkInfoBar::GetDelegate() {
85 return delegate()->AsLinkInfoBarDelegate(); 86 return delegate()->AsLinkInfoBarDelegate();
86 } 87 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/extension_infobar.cc ('k') | chrome/browser/ui/views/infobars/media_stream_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698