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

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

Issue 6574011: Cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/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 "chrome/browser/ui/views/infobars/infobar_text_button.h" 8 #include "views/controls/button/text_button.h"
9 #include "views/controls/image_view.h" 9 #include "views/controls/image_view.h"
10 #include "views/controls/label.h" 10 #include "views/controls/label.h"
11 11
12 TranslateMessageInfoBar::TranslateMessageInfoBar( 12 TranslateMessageInfoBar::TranslateMessageInfoBar(
13 TranslateInfoBarDelegate* delegate) 13 TranslateInfoBarDelegate* delegate)
14 : TranslateInfoBarBase(delegate), 14 : TranslateInfoBarBase(delegate),
15 button_(NULL) { 15 button_(NULL) {
16 label_ = CreateLabel(delegate->GetMessageInfoBarText()); 16 label_ = CreateLabel(delegate->GetMessageInfoBarText());
17 AddChildView(label_); 17 AddChildView(label_);
18 18
19 string16 button_text = delegate->GetMessageInfoBarButtonText(); 19 string16 button_text = delegate->GetMessageInfoBarButtonText();
20 if (!button_text.empty()) { 20 if (!button_text.empty()) {
21 button_ = InfoBarTextButton::Create(this, button_text); 21 button_ = CreateTextButton(this, button_text, false);
22 AddChildView(button_); 22 AddChildView(button_);
23 } 23 }
24 } 24 }
25 25
26 TranslateMessageInfoBar::~TranslateMessageInfoBar() { 26 TranslateMessageInfoBar::~TranslateMessageInfoBar() {
27 } 27 }
28 28
29 void TranslateMessageInfoBar::Layout() { 29 void TranslateMessageInfoBar::Layout() {
30 TranslateInfoBarBase::Layout(); 30 TranslateInfoBarBase::Layout();
31 31
(...skipping 14 matching lines...) Expand all
46 } 46 }
47 } 47 }
48 48
49 void TranslateMessageInfoBar::ButtonPressed(views::Button* sender, 49 void TranslateMessageInfoBar::ButtonPressed(views::Button* sender,
50 const views::Event& event) { 50 const views::Event& event) {
51 if (sender == button_) 51 if (sender == button_)
52 GetDelegate()->MessageInfoBarButtonPressed(); 52 GetDelegate()->MessageInfoBarButtonPressed();
53 else 53 else
54 TranslateInfoBarBase::ButtonPressed(sender, event); 54 TranslateInfoBarBase::ButtonPressed(sender, event);
55 } 55 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/translate_message_infobar.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698