OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/find_bar_gtk.h" | 5 #include "chrome/browser/ui/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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 411 } |
412 | 412 |
413 void FindBarGtk::AudibleAlert() { | 413 void FindBarGtk::AudibleAlert() { |
414 // This call causes a lot of weird bugs, especially when using the custom | 414 // This call causes a lot of weird bugs, especially when using the custom |
415 // frame. TODO(estade): if people complain, re-enable it. See | 415 // frame. TODO(estade): if people complain, re-enable it. See |
416 // http://crbug.com/27635 and others. | 416 // http://crbug.com/27635 and others. |
417 // | 417 // |
418 // gtk_widget_error_bell(widget()); | 418 // gtk_widget_error_bell(widget()); |
419 } | 419 } |
420 | 420 |
421 gfx::Rect FindBarGtk::GetDialogPosition(gfx::Rect avoid_overlapping_rect) { | 421 gfx::Rect FindBarGtk::GetDialogPosition( |
| 422 const gfx::Rect& avoid_overlapping_rect) { |
422 bool ltr = !base::i18n::IsRTL(); | 423 bool ltr = !base::i18n::IsRTL(); |
423 // 15 is the size of the scrollbar, copied from ScrollbarThemeChromium. | 424 // 15 is the size of the scrollbar, copied from ScrollbarThemeChromium. |
424 // The height is not used. | 425 // The height is not used. |
425 // At very low browser widths we can wind up with a negative |dialog_bounds| | 426 // At very low browser widths we can wind up with a negative |dialog_bounds| |
426 // width, so clamp it to 0. | 427 // width, so clamp it to 0. |
427 GtkAllocation parent_allocation; | 428 GtkAllocation parent_allocation; |
428 gtk_widget_get_allocation(gtk_widget_get_parent(widget()), | 429 gtk_widget_get_allocation(gtk_widget_get_parent(widget()), |
429 &parent_allocation); | 430 &parent_allocation); |
430 gfx::Rect dialog_bounds = gfx::Rect(ltr ? 0 : 15, 0, | 431 gfx::Rect dialog_bounds = gfx::Rect(ltr ? 0 : 15, 0, |
431 std::max(0, parent_allocation.width - (ltr ? 15 : 0)), 0); | 432 std::max(0, parent_allocation.width - (ltr ? 15 : 0)), 0); |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 return FALSE; // Continue propagation. | 995 return FALSE; // Continue propagation. |
995 } | 996 } |
996 | 997 |
997 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { | 998 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { |
998 g_signal_handlers_disconnect_by_func( | 999 g_signal_handlers_disconnect_by_func( |
999 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), | 1000 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), |
1000 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); | 1001 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); |
1001 | 1002 |
1002 return FALSE; // Continue propagation. | 1003 return FALSE; // Continue propagation. |
1003 } | 1004 } |
OLD | NEW |