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

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

Issue 7796010: Attempt at fixing crash in menus shown from infobars. Here's what the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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) 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/tab_contents/link_infobar_delegate.h" 8 #include "chrome/browser/tab_contents/link_infobar_delegate.h"
9 #include "chrome/browser/ui/views/event_utils.h" 9 #include "chrome/browser/ui/views/event_utils.h"
10 #include "views/controls/label.h" 10 #include "views/controls/label.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 label_2_ = CreateLabel(message_text.substr(offset)); 66 label_2_ = CreateLabel(message_text.substr(offset));
67 AddChildView(label_2_); 67 AddChildView(label_2_);
68 } 68 }
69 69
70 // This must happen after adding all other children so InfoBarView can ensure 70 // This must happen after adding all other children so InfoBarView can ensure
71 // the close button is the last child. 71 // the close button is the last child.
72 InfoBarView::ViewHierarchyChanged(is_add, parent, child); 72 InfoBarView::ViewHierarchyChanged(is_add, parent, child);
73 } 73 }
74 74
75 void LinkInfoBar::CancelMenu() {
76 }
77
75 void LinkInfoBar::LinkClicked(views::Link* source, int event_flags) { 78 void LinkInfoBar::LinkClicked(views::Link* source, int event_flags) {
76 DCHECK(link_ != NULL); 79 DCHECK(link_ != NULL);
77 DCHECK_EQ(link_, source); 80 DCHECK_EQ(link_, source);
78 if (GetDelegate()->LinkClicked( 81 if (GetDelegate()->LinkClicked(
79 event_utils::DispositionFromEventFlags(event_flags))) 82 event_utils::DispositionFromEventFlags(event_flags)))
80 RemoveSelf(); 83 RemoveSelf();
81 } 84 }
82 85
83 LinkInfoBarDelegate* LinkInfoBar::GetDelegate() { 86 LinkInfoBarDelegate* LinkInfoBar::GetDelegate() {
84 return delegate()->AsLinkInfoBarDelegate(); 87 return delegate()->AsLinkInfoBarDelegate();
85 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698