| OLD | NEW |
| 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/translate_message_infobar.h" | 5 #include "chrome/browser/ui/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 "ui/views/controls/button/label_button.h" | 8 #include "ui/views/controls/button/label_button.h" |
| 9 #include "ui/views/controls/label.h" | 9 #include "ui/views/controls/label.h" |
| 10 | 10 |
| 11 TranslateMessageInfoBar::TranslateMessageInfoBar( | 11 TranslateMessageInfoBar::TranslateMessageInfoBar( |
| 12 InfoBarService* owner, | 12 scoped_ptr<TranslateInfoBarDelegate> delegate) |
| 13 TranslateInfoBarDelegate* delegate) | 13 : TranslateInfoBarBase(delegate.Pass()), |
| 14 : TranslateInfoBarBase(owner, delegate), | |
| 15 label_(NULL), | 14 label_(NULL), |
| 16 button_(NULL) { | 15 button_(NULL) { |
| 17 } | 16 } |
| 18 | 17 |
| 19 TranslateMessageInfoBar::~TranslateMessageInfoBar() { | 18 TranslateMessageInfoBar::~TranslateMessageInfoBar() { |
| 20 } | 19 } |
| 21 | 20 |
| 22 void TranslateMessageInfoBar::Layout() { | 21 void TranslateMessageInfoBar::Layout() { |
| 23 TranslateInfoBarBase::Layout(); | 22 TranslateInfoBarBase::Layout(); |
| 24 | 23 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (sender == button_) | 60 if (sender == button_) |
| 62 GetDelegate()->MessageInfoBarButtonPressed(); | 61 GetDelegate()->MessageInfoBarButtonPressed(); |
| 63 else | 62 else |
| 64 TranslateInfoBarBase::ButtonPressed(sender, event); | 63 TranslateInfoBarBase::ButtonPressed(sender, event); |
| 65 } | 64 } |
| 66 | 65 |
| 67 int TranslateMessageInfoBar::ContentMinimumWidth() const { | 66 int TranslateMessageInfoBar::ContentMinimumWidth() const { |
| 68 return (button_ != NULL) ? | 67 return (button_ != NULL) ? |
| 69 (button_->GetPreferredSize().width() + kButtonInLabelSpacing) : 0; | 68 (button_->GetPreferredSize().width() + kButtonInLabelSpacing) : 0; |
| 70 } | 69 } |
| OLD | NEW |