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

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

Issue 150176: GTK: First draft of using native themes, partially based on evan's CL 118358. (Closed)
Patch Set: And the codereview tool is back. Created 11 years, 5 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
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/find_bar_gtk.h" 5 #include "chrome/browser/gtk/find_bar_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/gfx/gtk_util.h" 10 #include "base/gfx/gtk_util.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 close_button_.reset(CustomDrawButton::CloseButton()); 157 close_button_.reset(CustomDrawButton::CloseButton());
158 gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true, 158 gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true,
159 kCloseButtonPaddingLeft); 159 kCloseButtonPaddingLeft);
160 g_signal_connect(G_OBJECT(close_button_->widget()), "clicked", 160 g_signal_connect(G_OBJECT(close_button_->widget()), "clicked",
161 G_CALLBACK(OnClicked), this); 161 G_CALLBACK(OnClicked), this);
162 gtk_widget_set_tooltip_text(close_button_->widget(), 162 gtk_widget_set_tooltip_text(close_button_->widget(),
163 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str()); 163 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str());
164 164
165 find_next_button_.reset(new CustomDrawButton(IDR_FINDINPAGE_NEXT, 165 find_next_button_.reset(new CustomDrawButton(IDR_FINDINPAGE_NEXT,
166 IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_P)); 166 IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_P,
167 NULL));
167 g_signal_connect(G_OBJECT(find_next_button_->widget()), "clicked", 168 g_signal_connect(G_OBJECT(find_next_button_->widget()), "clicked",
168 G_CALLBACK(OnClicked), this); 169 G_CALLBACK(OnClicked), this);
169 gtk_widget_set_tooltip_text(find_next_button_->widget(), 170 gtk_widget_set_tooltip_text(find_next_button_->widget(),
170 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_NEXT_TOOLTIP).c_str()); 171 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_NEXT_TOOLTIP).c_str());
171 gtk_box_pack_end(GTK_BOX(hbox), find_next_button_->widget(), 172 gtk_box_pack_end(GTK_BOX(hbox), find_next_button_->widget(),
172 FALSE, FALSE, 0); 173 FALSE, FALSE, 0);
173 174
174 find_previous_button_.reset(new CustomDrawButton(IDR_FINDINPAGE_PREV, 175 find_previous_button_.reset(new CustomDrawButton(IDR_FINDINPAGE_PREV,
175 IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_P)); 176 IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_P,
177 NULL));
176 g_signal_connect(G_OBJECT(find_previous_button_->widget()), "clicked", 178 g_signal_connect(G_OBJECT(find_previous_button_->widget()), "clicked",
177 G_CALLBACK(OnClicked), this); 179 G_CALLBACK(OnClicked), this);
178 gtk_widget_set_tooltip_text(find_previous_button_->widget(), 180 gtk_widget_set_tooltip_text(find_previous_button_->widget(),
179 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP).c_str()); 181 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP).c_str());
180 gtk_box_pack_end(GTK_BOX(hbox), find_previous_button_->widget(), 182 gtk_box_pack_end(GTK_BOX(hbox), find_previous_button_->widget(),
181 FALSE, FALSE, 0); 183 FALSE, FALSE, 0);
182 184
183 // Make a box for the edit and match count widgets. This is fixed size since 185 // Make a box for the edit and match count widgets. This is fixed size since
184 // we want the widgets inside to resize themselves rather than making the 186 // we want the widgets inside to resize themselves rather than making the
185 // dialog bigger. 187 // dialog bigger.
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 } 538 }
537 539
538 // static 540 // static
539 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e, 541 gboolean FindBarGtk::OnButtonPress(GtkWidget* text_entry, GdkEventButton* e,
540 FindBarGtk* find_bar) { 542 FindBarGtk* find_bar) {
541 find_bar->StoreOutsideFocus(); 543 find_bar->StoreOutsideFocus();
542 544
543 // Continue propagating the event. 545 // Continue propagating the event.
544 return FALSE; 546 return FALSE;
545 } 547 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698