OLD | NEW |
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/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 <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 close_button_.reset(CustomDrawButton::CloseButton(theme_provider_)); | 233 close_button_.reset(CustomDrawButton::CloseButton(theme_provider_)); |
234 gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true, | 234 gtk_util::CenterWidgetInHBox(hbox, close_button_->widget(), true, |
235 kCloseButtonPaddingLeft); | 235 kCloseButtonPaddingLeft); |
236 g_signal_connect(close_button_->widget(), "clicked", | 236 g_signal_connect(close_button_->widget(), "clicked", |
237 G_CALLBACK(OnClicked), this); | 237 G_CALLBACK(OnClicked), this); |
238 gtk_widget_set_tooltip_text(close_button_->widget(), | 238 gtk_widget_set_tooltip_text(close_button_->widget(), |
239 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str()); | 239 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP).c_str()); |
240 | 240 |
241 find_next_button_.reset(new CustomDrawButton(theme_provider_, | 241 find_next_button_.reset(new CustomDrawButton(theme_provider_, |
242 IDR_FINDINPAGE_NEXT, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, | 242 IDR_FINDINPAGE_NEXT, IDR_FINDINPAGE_NEXT_H, IDR_FINDINPAGE_NEXT_H, |
243 IDR_FINDINPAGE_NEXT_P, 0, GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU)); | 243 IDR_FINDINPAGE_NEXT_P, GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_MENU)); |
244 g_signal_connect(find_next_button_->widget(), "clicked", | 244 g_signal_connect(find_next_button_->widget(), "clicked", |
245 G_CALLBACK(OnClicked), this); | 245 G_CALLBACK(OnClicked), this); |
246 gtk_widget_set_tooltip_text(find_next_button_->widget(), | 246 gtk_widget_set_tooltip_text(find_next_button_->widget(), |
247 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_NEXT_TOOLTIP).c_str()); | 247 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_NEXT_TOOLTIP).c_str()); |
248 gtk_box_pack_end(GTK_BOX(hbox), find_next_button_->widget(), | 248 gtk_box_pack_end(GTK_BOX(hbox), find_next_button_->widget(), |
249 FALSE, FALSE, 0); | 249 FALSE, FALSE, 0); |
250 | 250 |
251 find_previous_button_.reset(new CustomDrawButton(theme_provider_, | 251 find_previous_button_.reset(new CustomDrawButton(theme_provider_, |
252 IDR_FINDINPAGE_PREV, IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_H, | 252 IDR_FINDINPAGE_PREV, IDR_FINDINPAGE_PREV_H, IDR_FINDINPAGE_PREV_H, |
253 IDR_FINDINPAGE_PREV_P, 0, GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU)); | 253 IDR_FINDINPAGE_PREV_P, GTK_STOCK_GO_UP, GTK_ICON_SIZE_MENU)); |
254 g_signal_connect(find_previous_button_->widget(), "clicked", | 254 g_signal_connect(find_previous_button_->widget(), "clicked", |
255 G_CALLBACK(OnClicked), this); | 255 G_CALLBACK(OnClicked), this); |
256 gtk_widget_set_tooltip_text(find_previous_button_->widget(), | 256 gtk_widget_set_tooltip_text(find_previous_button_->widget(), |
257 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP).c_str()); | 257 l10n_util::GetStringUTF8(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP).c_str()); |
258 gtk_box_pack_end(GTK_BOX(hbox), find_previous_button_->widget(), | 258 gtk_box_pack_end(GTK_BOX(hbox), find_previous_button_->widget(), |
259 FALSE, FALSE, 0); | 259 FALSE, FALSE, 0); |
260 | 260 |
261 // Make a box for the edit and match count widgets. This is fixed size since | 261 // Make a box for the edit and match count widgets. This is fixed size since |
262 // we want the widgets inside to resize themselves rather than making the | 262 // we want the widgets inside to resize themselves rather than making the |
263 // dialog bigger. | 263 // dialog bigger. |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 957 |
958 // static | 958 // static |
959 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event, | 959 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event, |
960 FindBarGtk* find_bar) { | 960 FindBarGtk* find_bar) { |
961 g_signal_handlers_disconnect_by_func( | 961 g_signal_handlers_disconnect_by_func( |
962 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), | 962 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), |
963 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar); | 963 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar); |
964 | 964 |
965 return FALSE; // Continue propagation. | 965 return FALSE; // Continue propagation. |
966 } | 966 } |
OLD | NEW |