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 19 matching lines...) Expand all Loading... |
30 #include "chrome/browser/ui/gtk/nine_box.h" | 30 #include "chrome/browser/ui/gtk/nine_box.h" |
31 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" | 31 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" |
32 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" | 32 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" |
33 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" | 33 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
34 #include "chrome/browser/ui/gtk/view_id_util.h" | 34 #include "chrome/browser/ui/gtk/view_id_util.h" |
35 #include "chrome/common/chrome_notification_types.h" | 35 #include "chrome/common/chrome_notification_types.h" |
36 #include "content/public/browser/native_web_keyboard_event.h" | 36 #include "content/public/browser/native_web_keyboard_event.h" |
37 #include "content/public/browser/notification_source.h" | 37 #include "content/public/browser/notification_source.h" |
38 #include "content/public/browser/render_view_host.h" | 38 #include "content/public/browser/render_view_host.h" |
39 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
| 40 #include "content/public/browser/web_contents_view.h" |
40 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
41 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
42 #include "grit/ui_resources.h" | 43 #include "grit/ui_resources.h" |
43 #include "ui/base/gtk/gtk_floating_container.h" | 44 #include "ui/base/gtk/gtk_floating_container.h" |
44 #include "ui/base/gtk/gtk_hig_constants.h" | 45 #include "ui/base/gtk/gtk_hig_constants.h" |
45 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
46 #include "ui/base/resource/resource_bundle.h" | 47 #include "ui/base/resource/resource_bundle.h" |
47 #include "ui/gfx/image/cairo_cached_surface.h" | 48 #include "ui/gfx/image/cairo_cached_surface.h" |
48 #include "ui/gfx/image/image.h" | 49 #include "ui/gfx/image/image.h" |
49 | 50 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 459 |
459 void FindBarGtk::RestoreSavedFocus() { | 460 void FindBarGtk::RestoreSavedFocus() { |
460 // This function sometimes gets called when we don't have focus. We should do | 461 // This function sometimes gets called when we don't have focus. We should do |
461 // nothing in this case. | 462 // nothing in this case. |
462 if (!gtk_widget_is_focus(text_entry_)) | 463 if (!gtk_widget_is_focus(text_entry_)) |
463 return; | 464 return; |
464 | 465 |
465 if (focus_store_.widget()) | 466 if (focus_store_.widget()) |
466 gtk_widget_grab_focus(focus_store_.widget()); | 467 gtk_widget_grab_focus(focus_store_.widget()); |
467 else | 468 else |
468 find_bar_controller_->web_contents()->Focus(); | 469 find_bar_controller_->web_contents()->GetView()->Focus(); |
469 } | 470 } |
470 | 471 |
471 FindBarTesting* FindBarGtk::GetFindBarTesting() { | 472 FindBarTesting* FindBarGtk::GetFindBarTesting() { |
472 return this; | 473 return this; |
473 } | 474 } |
474 | 475 |
475 void FindBarGtk::Observe(int type, | 476 void FindBarGtk::Observe(int type, |
476 const content::NotificationSource& source, | 477 const content::NotificationSource& source, |
477 const content::NotificationDetails& details) { | 478 const content::NotificationDetails& details) { |
478 DCHECK_EQ(type, chrome::NOTIFICATION_BROWSER_THEME_CHANGED); | 479 DCHECK_EQ(type, chrome::NOTIFICATION_BROWSER_THEME_CHANGED); |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 return FALSE; // Continue propagation. | 1019 return FALSE; // Continue propagation. |
1019 } | 1020 } |
1020 | 1021 |
1021 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { | 1022 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { |
1022 g_signal_handlers_disconnect_by_func( | 1023 g_signal_handlers_disconnect_by_func( |
1023 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), | 1024 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), |
1024 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); | 1025 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); |
1025 | 1026 |
1026 return FALSE; // Continue propagation. | 1027 return FALSE; // Continue propagation. |
1027 } | 1028 } |
OLD | NEW |