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

Side by Side Diff: chrome/browser/gtk/translate/translate_message_infobar_gtk.cc

Issue 4767001: Make TabContents own its infobar delegates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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) 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/gtk/translate/translate_message_infobar_gtk.h" 5 #include "chrome/browser/gtk/translate/translate_message_infobar_gtk.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/gtk/gtk_util.h" 8 #include "chrome/browser/gtk/gtk_util.h"
9 #include "chrome/browser/translate/translate_infobar_delegate.h" 9 #include "chrome/browser/translate/translate_infobar_delegate.h"
10 10
(...skipping 16 matching lines...) Expand all
27 string16 button_text = GetDelegate()->GetMessageInfoBarButtonText(); 27 string16 button_text = GetDelegate()->GetMessageInfoBarButtonText();
28 if (!button_text.empty()) { 28 if (!button_text.empty()) {
29 GtkWidget* button = 29 GtkWidget* button =
30 gtk_button_new_with_label(UTF16ToUTF8(button_text).c_str()); 30 gtk_button_new_with_label(UTF16ToUTF8(button_text).c_str());
31 g_signal_connect(button, "clicked",G_CALLBACK(&OnButtonPressedThunk), this); 31 g_signal_connect(button, "clicked",G_CALLBACK(&OnButtonPressedThunk), this);
32 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 32 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
33 } 33 }
34 } 34 }
35 35
36 void TranslateMessageInfoBar::OnButtonPressed(GtkWidget* sender) { 36 void TranslateMessageInfoBar::OnButtonPressed(GtkWidget* sender) {
37 GetDelegate()->MessageInfoBarButtonPressed(); 37 if (delegate())
38 GetDelegate()->MessageInfoBarButtonPressed();
38 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698