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

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

Issue 14327008: Add InitWidgets() phase for GTK infobars. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/button/text_button.h" 8 #include "ui/views/controls/button/text_button.h"
9 #include "ui/views/controls/label.h" 9 #include "ui/views/controls/label.h"
10 10
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 } 51 }
52 52
53 // This must happen after adding all other children so InfoBarView can ensure 53 // This must happen after adding all other children so InfoBarView can ensure
54 // the close button is the last child. 54 // the close button is the last child.
55 TranslateInfoBarBase::ViewHierarchyChanged(is_add, parent, child); 55 TranslateInfoBarBase::ViewHierarchyChanged(is_add, parent, child);
56 } 56 }
57 57
58 void TranslateMessageInfoBar::ButtonPressed(views::Button* sender, 58 void TranslateMessageInfoBar::ButtonPressed(views::Button* sender,
59 const ui::Event& event) { 59 const ui::Event& event) {
60 if (!owned()) 60 if (!owner())
61 return; // We're closing; don't call anything, it might access the owner. 61 return; // We're closing; don't call anything, it might access the owner.
62 if (sender == button_) 62 if (sender == button_)
63 GetDelegate()->MessageInfoBarButtonPressed(); 63 GetDelegate()->MessageInfoBarButtonPressed();
64 else 64 else
65 TranslateInfoBarBase::ButtonPressed(sender, event); 65 TranslateInfoBarBase::ButtonPressed(sender, event);
66 } 66 }
67 67
68 int TranslateMessageInfoBar::ContentMinimumWidth() const { 68 int TranslateMessageInfoBar::ContentMinimumWidth() const {
69 return (button_ != NULL) ? 69 return (button_ != NULL) ?
70 (button_->GetPreferredSize().width() + kButtonInLabelSpacing) : 0; 70 (button_->GetPreferredSize().width() + kButtonInLabelSpacing) : 0;
71 } 71 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698