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

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

Issue 5783004: Keep deinlining stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Well, it all compiles locally? Created 10 years 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/after_translate_infobar_gtk.h" 5 #include "chrome/browser/gtk/translate/after_translate_infobar_gtk.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/gtk/gtk_util.h" 10 #include "chrome/browser/gtk/gtk_util.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 FALSE, FALSE, 0); 57 FALSE, FALSE, 0);
58 gtk_box_pack_start(GTK_BOX(hbox), CreateLabel(UTF16ToUTF8(strings[2])), 58 gtk_box_pack_start(GTK_BOX(hbox), CreateLabel(UTF16ToUTF8(strings[2])),
59 FALSE, FALSE, 0); 59 FALSE, FALSE, 0);
60 60
61 GtkWidget* button = gtk_button_new_with_label( 61 GtkWidget* button = gtk_button_new_with_label(
62 l10n_util::GetStringUTF8(IDS_TRANSLATE_INFOBAR_REVERT).c_str()); 62 l10n_util::GetStringUTF8(IDS_TRANSLATE_INFOBAR_REVERT).c_str());
63 g_signal_connect(button, "clicked",G_CALLBACK(&OnRevertPressedThunk), this); 63 g_signal_connect(button, "clicked",G_CALLBACK(&OnRevertPressedThunk), this);
64 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); 64 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
65 } 65 }
66 66
67 bool AfterTranslateInfoBar::ShowOptionsMenuButton() const {
68 return true;
69 }
70
67 void AfterTranslateInfoBar::OnOriginalLanguageModified(GtkWidget* sender) { 71 void AfterTranslateInfoBar::OnOriginalLanguageModified(GtkWidget* sender) {
68 int index = GetLanguageComboboxActiveId(GTK_COMBO_BOX(sender)); 72 int index = GetLanguageComboboxActiveId(GTK_COMBO_BOX(sender));
69 if (index == GetDelegate()->original_language_index()) 73 if (index == GetDelegate()->original_language_index())
70 return; 74 return;
71 75
72 // Setting the language will lead to a new translation that is going to close 76 // Setting the language will lead to a new translation that is going to close
73 // the infobar. This is not OK to do this from the signal handler, so we'll 77 // the infobar. This is not OK to do this from the signal handler, so we'll
74 // defer it. 78 // defer it.
75 MessageLoop::current()->PostTask(FROM_HERE, method_factory_.NewRunnableMethod( 79 MessageLoop::current()->PostTask(FROM_HERE, method_factory_.NewRunnableMethod(
76 &AfterTranslateInfoBar::SetOriginalLanguage, index)); 80 &AfterTranslateInfoBar::SetOriginalLanguage, index));
(...skipping 13 matching lines...) Expand all
90 GetDelegate()->RevertTranslation(); 94 GetDelegate()->RevertTranslation();
91 } 95 }
92 96
93 void AfterTranslateInfoBar::SetOriginalLanguage(int language_index) { 97 void AfterTranslateInfoBar::SetOriginalLanguage(int language_index) {
94 GetDelegate()->SetOriginalLanguage(language_index); 98 GetDelegate()->SetOriginalLanguage(language_index);
95 } 99 }
96 100
97 void AfterTranslateInfoBar::SetTargetLanguage(int language_index) { 101 void AfterTranslateInfoBar::SetTargetLanguage(int language_index) {
98 GetDelegate()->SetTargetLanguage(language_index); 102 GetDelegate()->SetTargetLanguage(language_index);
99 } 103 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698