OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/infobars/translate_message_infobar.h" | 5 #include "chrome/browser/views/infobars/translate_message_infobar.h" |
6 | 6 |
7 #include "chrome/browser/translate/translate_infobar_delegate.h" | 7 #include "chrome/browser/translate/translate_infobar_delegate.h" |
8 #include "chrome/browser/views/infobars/infobar_text_button.h" | 8 #include "chrome/browser/views/infobars/infobar_text_button.h" |
9 #include "views/controls/image_view.h" | 9 #include "views/controls/image_view.h" |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 if (button_) { | 42 if (button_) { |
43 button_->SetBounds(label_->bounds().right() + | 43 button_->SetBounds(label_->bounds().right() + |
44 InfoBar::kButtonInLabelSpacing, | 44 InfoBar::kButtonInLabelSpacing, |
45 InfoBar::OffsetY(this, button_pref_size), | 45 InfoBar::OffsetY(this, button_pref_size), |
46 button_pref_size.width(), button_pref_size.height()); | 46 button_pref_size.width(), button_pref_size.height()); |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 void TranslateMessageInfoBar::ButtonPressed(views::Button* sender, | 50 void TranslateMessageInfoBar::ButtonPressed(views::Button* sender, |
51 const views::Event& event) { | 51 const views::Event& event) { |
52 if (sender == button_) { | 52 if (delegate() && (sender == button_)) { |
53 GetDelegate()->MessageInfoBarButtonPressed(); | 53 GetDelegate()->MessageInfoBarButtonPressed(); |
54 return; | 54 return; |
55 } | 55 } |
56 TranslateInfoBarBase::ButtonPressed(sender, event); | 56 TranslateInfoBarBase::ButtonPressed(sender, event); |
57 } | 57 } |
OLD | NEW |