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

Side by Side Diff: chrome/browser/ui/views/infobars/confirm_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/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/tab_contents/confirm_infobar_delegate.h" 8 #include "chrome/browser/tab_contents/confirm_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/button/text_button.h" 10 #include "views/controls/button/text_button.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 int width = (link_ == NULL) ? 0 : kEndOfLabelSpacing; // Space before link 114 int width = (link_ == NULL) ? 0 : kEndOfLabelSpacing; // Space before link
115 int before_cancel_spacing = kEndOfLabelSpacing; 115 int before_cancel_spacing = kEndOfLabelSpacing;
116 if (ok_button_ != NULL) { 116 if (ok_button_ != NULL) {
117 width += kEndOfLabelSpacing + ok_button_->GetPreferredSize().width(); 117 width += kEndOfLabelSpacing + ok_button_->GetPreferredSize().width();
118 before_cancel_spacing = kButtonButtonSpacing; 118 before_cancel_spacing = kButtonButtonSpacing;
119 } 119 }
120 return width + ((cancel_button_ == NULL) ? 0 : 120 return width + ((cancel_button_ == NULL) ? 0 :
121 (before_cancel_spacing + cancel_button_->GetPreferredSize().width())); 121 (before_cancel_spacing + cancel_button_->GetPreferredSize().width()));
122 } 122 }
123 123
124 void ConfirmInfoBar::CancelMenu() {
125 }
126
124 void ConfirmInfoBar::LinkClicked(views::Link* source, int event_flags) { 127 void ConfirmInfoBar::LinkClicked(views::Link* source, int event_flags) {
125 DCHECK(link_ != NULL); 128 DCHECK(link_ != NULL);
126 DCHECK_EQ(link_, source); 129 DCHECK_EQ(link_, source);
127 if (GetDelegate()->LinkClicked( 130 if (GetDelegate()->LinkClicked(
128 event_utils::DispositionFromEventFlags(event_flags))) 131 event_utils::DispositionFromEventFlags(event_flags)))
129 RemoveSelf(); 132 RemoveSelf();
130 } 133 }
131 134
132 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() { 135 ConfirmInfoBarDelegate* ConfirmInfoBar::GetDelegate() {
133 return delegate()->AsConfirmInfoBarDelegate(); 136 return delegate()->AsConfirmInfoBarDelegate();
134 } 137 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698