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

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

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/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/event_disposition.h" 8 #include "chrome/browser/event_disposition.h"
9 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 9 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
10 #include "ui/views/controls/button/text_button.h" 10 #include "ui/views/controls/button/text_button.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 AddChildView(link_); 90 AddChildView(link_);
91 } 91 }
92 } 92 }
93 93
94 // This must happen after adding all other children so InfoBarView can ensure 94 // This must happen after adding all other children so InfoBarView can ensure
95 // the close button is the last child. 95 // the close button is the last child.
96 InfoBarView::ViewHierarchyChanged(is_add, parent, child); 96 InfoBarView::ViewHierarchyChanged(is_add, parent, child);
97 } 97 }
98 98
99 void ConfirmInfoBar::ButtonPressed(views::Button* sender, 99 void ConfirmInfoBar::ButtonPressed(views::Button* sender,
100 const views::Event& event) { 100 const ui::Event& event) {
101 if (!owned()) 101 if (!owned())
102 return; // We're closing; don't call anything, it might access the owner. 102 return; // We're closing; don't call anything, it might access the owner.
103 ConfirmInfoBarDelegate* delegate = GetDelegate(); 103 ConfirmInfoBarDelegate* delegate = GetDelegate();
104 if ((ok_button_ != NULL) && sender == ok_button_) { 104 if ((ok_button_ != NULL) && sender == ok_button_) {
105 if (delegate->Accept()) 105 if (delegate->Accept())
106 RemoveSelf(); 106 RemoveSelf();
107 } else if ((cancel_button_ != NULL) && (sender == cancel_button_)) { 107 } else if ((cancel_button_ != NULL) && (sender == cancel_button_)) {
108 if (delegate->Cancel()) 108 if (delegate->Cancel())
109 RemoveSelf(); 109 RemoveSelf();
110 } else { 110 } else {
(...skipping 18 matching lines...) Expand all
129 DCHECK(link_ != NULL); 129 DCHECK(link_ != NULL);
130 DCHECK_EQ(link_, source); 130 DCHECK_EQ(link_, source);
131 if (GetDelegate()->LinkClicked( 131 if (GetDelegate()->LinkClicked(
132 chrome::DispositionFromEventFlags(event_flags))) 132 chrome::DispositionFromEventFlags(event_flags)))
133 RemoveSelf(); 133 RemoveSelf();
134 } 134 }
135 135
136 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { 136 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() {
137 return delegate()->AsConfirmInfoBarDelegate(); 137 return delegate()->AsConfirmInfoBarDelegate();
138 } 138 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.h ('k') | chrome/browser/ui/views/infobars/infobar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698