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

Side by Side Diff: chrome/browser/gtk/infobar_gtk.cc

Issue 160491: revert 22226 as it caused some ui test crashes (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 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/gtk/gtk_chrome_link_button.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/infobar_gtk.h" 5 #include "chrome/browser/gtk/infobar_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "base/gfx/gtk_util.h" 9 #include "base/gfx/gtk_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 LinkInfoBar(LinkInfoBarDelegate* delegate) 177 LinkInfoBar(LinkInfoBarDelegate* delegate)
178 : InfoBar(delegate) { 178 : InfoBar(delegate) {
179 size_t link_offset; 179 size_t link_offset;
180 std::wstring display_text = 180 std::wstring display_text =
181 delegate->GetMessageTextWithOffset(&link_offset); 181 delegate->GetMessageTextWithOffset(&link_offset);
182 std::wstring link_text = delegate->GetLinkText(); 182 std::wstring link_text = delegate->GetLinkText();
183 183
184 // Create the link button. 184 // Create the link button.
185 GtkWidget* link_button = 185 GtkWidget* link_button =
186 gtk_chrome_link_button_new(WideToUTF8(link_text).c_str()); 186 gtk_chrome_link_button_new(WideToUTF8(link_text).c_str());
187 gtk_chrome_link_button_set_use_gtk_theme(
188 GTK_CHROME_LINK_BUTTON(link_button), FALSE);
189 g_signal_connect(link_button, "clicked", 187 g_signal_connect(link_button, "clicked",
190 G_CALLBACK(OnLinkClick), this); 188 G_CALLBACK(OnLinkClick), this);
191 189
192 // If link_offset is npos, we right-align the link instead of embedding it 190 // If link_offset is npos, we right-align the link instead of embedding it
193 // in the text. 191 // in the text.
194 if (link_offset == std::wstring::npos) { 192 if (link_offset == std::wstring::npos) {
195 gtk_box_pack_end(GTK_BOX(hbox_), link_button, FALSE, FALSE, 0); 193 gtk_box_pack_end(GTK_BOX(hbox_), link_button, FALSE, FALSE, 0);
196 GtkWidget* label = gtk_label_new(WideToUTF8(display_text).c_str()); 194 GtkWidget* label = gtk_label_new(WideToUTF8(display_text).c_str());
197 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &gfx::kGdkBlack); 195 gtk_widget_modify_fg(label, GTK_STATE_NORMAL, &gfx::kGdkBlack);
198 gtk_box_pack_start(GTK_BOX(hbox_), label, FALSE, FALSE, 0); 196 gtk_box_pack_start(GTK_BOX(hbox_), label, FALSE, FALSE, 0);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 281
284 InfoBar* LinkInfoBarDelegate::CreateInfoBar() { 282 InfoBar* LinkInfoBarDelegate::CreateInfoBar() {
285 return new LinkInfoBar(this); 283 return new LinkInfoBar(this);
286 } 284 }
287 285
288 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: -------------------------- 286 // ConfirmInfoBarDelegate, InfoBarDelegate overrides: --------------------------
289 287
290 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() { 288 InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() {
291 return new ConfirmInfoBar(this); 289 return new ConfirmInfoBar(this);
292 } 290 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/gtk_chrome_link_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698