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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 304 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, |
305 NotificationService::AllSources()); | 305 NotificationService::AllSources()); |
306 | 306 |
307 g_signal_connect(widget(), "parent-set", G_CALLBACK(OnParentSet), this); | 307 g_signal_connect(widget(), "parent-set", G_CALLBACK(OnParentSet), this); |
308 | 308 |
309 // We take care to avoid showing the slide animator widget. | 309 // We take care to avoid showing the slide animator widget. |
310 gtk_widget_show_all(container_); | 310 gtk_widget_show_all(container_); |
311 gtk_widget_show(widget()); | 311 gtk_widget_show(widget()); |
312 } | 312 } |
313 | 313 |
| 314 FindBarController* FindBarGtk::GetFindBarController() const { |
| 315 return find_bar_controller_; |
| 316 } |
| 317 |
| 318 void FindBarGtk::SetFindBarController(FindBarController* find_bar_controller) { |
| 319 find_bar_controller_ = find_bar_controller; |
| 320 } |
| 321 |
314 void FindBarGtk::Show(bool animate) { | 322 void FindBarGtk::Show(bool animate) { |
315 if (animate) { | 323 if (animate) { |
316 slide_widget_->Open(); | 324 slide_widget_->Open(); |
317 selection_rect_ = gfx::Rect(); | 325 selection_rect_ = gfx::Rect(); |
318 Reposition(); | 326 Reposition(); |
319 if (container_->window) | 327 if (container_->window) |
320 gdk_window_raise(container_->window); | 328 gdk_window_raise(container_->window); |
321 } else { | 329 } else { |
322 slide_widget_->OpenWithoutAnimation(); | 330 slide_widget_->OpenWithoutAnimation(); |
323 } | 331 } |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 | 967 |
960 // static | 968 // static |
961 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event, | 969 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event, |
962 FindBarGtk* find_bar) { | 970 FindBarGtk* find_bar) { |
963 g_signal_handlers_disconnect_by_func( | 971 g_signal_handlers_disconnect_by_func( |
964 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), | 972 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), |
965 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar); | 973 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), find_bar); |
966 | 974 |
967 return FALSE; // Continue propagation. | 975 return FALSE; // Continue propagation. |
968 } | 976 } |
OLD | NEW |