| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/debug/trace_event.h" | 13 #include "base/debug/trace_event.h" |
| 14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 20 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 21 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 21 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 22 #include "chrome/browser/ui/find_bar/find_bar_state_factory.h" | 22 #include "chrome/browser/ui/find_bar/find_bar_state_factory.h" |
| 23 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 23 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 25 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 25 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| 26 #include "chrome/browser/ui/gtk/custom_button.h" | 26 #include "chrome/browser/ui/gtk/custom_button.h" |
| 27 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 28 #include "chrome/browser/ui/gtk/gtk_util.h" | 27 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 29 #include "chrome/browser/ui/gtk/nine_box.h" | 28 #include "chrome/browser/ui/gtk/nine_box.h" |
| 30 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" | 29 #include "chrome/browser/ui/gtk/slide_animator_gtk.h" |
| 31 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" | 30 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" |
| 32 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" | 31 #include "chrome/browser/ui/gtk/tabs/tab_strip_gtk.h" |
| 32 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 33 #include "chrome/browser/ui/gtk/view_id_util.h" | 33 #include "chrome/browser/ui/gtk/view_id_util.h" |
| 34 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 34 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 35 #include "chrome/common/chrome_notification_types.h" | 35 #include "chrome/common/chrome_notification_types.h" |
| 36 #include "content/browser/renderer_host/render_view_host.h" | 36 #include "content/browser/renderer_host/render_view_host.h" |
| 37 #include "content/public/browser/native_web_keyboard_event.h" | 37 #include "content/public/browser/native_web_keyboard_event.h" |
| 38 #include "content/public/browser/notification_source.h" | 38 #include "content/public/browser/notification_source.h" |
| 39 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
| 40 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
| 41 #include "grit/theme_resources.h" | 41 #include "grit/theme_resources.h" |
| 42 #include "grit/ui_resources_standard.h" | 42 #include "grit/ui_resources_standard.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 padding_right); | 171 padding_right); |
| 172 gtk_container_add(GTK_CONTAINER(*alignment), child); | 172 gtk_container_add(GTK_CONTAINER(*alignment), child); |
| 173 gtk_container_add(GTK_CONTAINER(*ebox), *alignment); | 173 gtk_container_add(GTK_CONTAINER(*ebox), *alignment); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace | 176 } // namespace |
| 177 | 177 |
| 178 FindBarGtk::FindBarGtk(BrowserWindowGtk* window) | 178 FindBarGtk::FindBarGtk(BrowserWindowGtk* window) |
| 179 : browser_(window->browser()), | 179 : browser_(window->browser()), |
| 180 window_(window), | 180 window_(window), |
| 181 theme_service_(GtkThemeService::GetFrom(browser_->profile())), | 181 theme_service_(ThemeServiceGtk::GetFrom(browser_->profile())), |
| 182 container_width_(-1), | 182 container_width_(-1), |
| 183 container_height_(-1), | 183 container_height_(-1), |
| 184 match_label_failure_(false), | 184 match_label_failure_(false), |
| 185 ignore_changed_signal_(false) { | 185 ignore_changed_signal_(false) { |
| 186 InitWidgets(); | 186 InitWidgets(); |
| 187 ViewIDUtil::SetID(text_entry_, VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); | 187 ViewIDUtil::SetID(text_entry_, VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); |
| 188 | 188 |
| 189 // Insert the widget into the browser gtk hierarchy. | 189 // Insert the widget into the browser gtk hierarchy. |
| 190 window_->AddFindBar(this); | 190 window_->AddFindBar(this); |
| 191 | 191 |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 return FALSE; // Continue propagation. | 994 return FALSE; // Continue propagation. |
| 995 } | 995 } |
| 996 | 996 |
| 997 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { | 997 gboolean FindBarGtk::OnFocusOut(GtkWidget* entry, GdkEventFocus* event) { |
| 998 g_signal_handlers_disconnect_by_func( | 998 g_signal_handlers_disconnect_by_func( |
| 999 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), | 999 gdk_keymap_get_for_display(gtk_widget_get_display(entry)), |
| 1000 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); | 1000 reinterpret_cast<gpointer>(&OnKeymapDirectionChanged), this); |
| 1001 | 1001 |
| 1002 return FALSE; // Continue propagation. | 1002 return FALSE; // Continue propagation. |
| 1003 } | 1003 } |
| OLD | NEW |