| 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/omnibox/omnibox_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "ui/gfx/gtk_util.h" | 47 #include "ui/gfx/gtk_util.h" |
| 48 #include "ui/gfx/skia_utils_gtk.h" | 48 #include "ui/gfx/skia_utils_gtk.h" |
| 49 | 49 |
| 50 #if defined(TOOLKIT_VIEWS) | 50 #if defined(TOOLKIT_VIEWS) |
| 51 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" | 51 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" |
| 52 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 52 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 53 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 53 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 54 #include "ui/views/controls/textfield/native_textfield_views.h" | 54 #include "ui/views/controls/textfield/native_textfield_views.h" |
| 55 #include "ui/views/events/event.h" | 55 #include "ui/views/events/event.h" |
| 56 #else | 56 #else |
| 57 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 58 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" | 57 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
| 59 #include "chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h" | 58 #include "chrome/browser/ui/gtk/omnibox/omnibox_popup_view_gtk.h" |
| 59 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 60 #endif | 60 #endif |
| 61 | 61 |
| 62 using content::WebContents; | 62 using content::WebContents; |
| 63 | 63 |
| 64 namespace { | 64 namespace { |
| 65 | 65 |
| 66 const gchar* kOmniboxViewGtkKey = "__OMNIBOX_VIEW_GTK__"; | 66 const gchar* kOmniboxViewGtkKey = "__OMNIBOX_VIEW_GTK__"; |
| 67 | 67 |
| 68 const char kTextBaseColor[] = "#808080"; | 68 const char kTextBaseColor[] = "#808080"; |
| 69 const char kSecureSchemeColor[] = "#079500"; | 69 const char kSecureSchemeColor[] = "#079500"; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 security_level_(ToolbarModel::NONE), | 190 security_level_(ToolbarModel::NONE), |
| 191 mark_set_handler_id_(0), | 191 mark_set_handler_id_(0), |
| 192 button_1_pressed_(false), | 192 button_1_pressed_(false), |
| 193 #if defined(OS_CHROMEOS) | 193 #if defined(OS_CHROMEOS) |
| 194 text_selected_during_click_(false), | 194 text_selected_during_click_(false), |
| 195 text_view_focused_before_button_press_(false), | 195 text_view_focused_before_button_press_(false), |
| 196 #endif | 196 #endif |
| 197 #if defined(TOOLKIT_VIEWS) | 197 #if defined(TOOLKIT_VIEWS) |
| 198 location_bar_view_(location_bar), | 198 location_bar_view_(location_bar), |
| 199 #else | 199 #else |
| 200 theme_service_(GtkThemeService::GetFrom(profile)), | 200 theme_service_(ThemeServiceGtk::GetFrom(profile)), |
| 201 #endif | 201 #endif |
| 202 enter_was_pressed_(false), | 202 enter_was_pressed_(false), |
| 203 tab_was_pressed_(false), | 203 tab_was_pressed_(false), |
| 204 paste_clipboard_requested_(false), | 204 paste_clipboard_requested_(false), |
| 205 enter_was_inserted_(false), | 205 enter_was_inserted_(false), |
| 206 selection_suggested_(false), | 206 selection_suggested_(false), |
| 207 delete_was_pressed_(false), | 207 delete_was_pressed_(false), |
| 208 delete_at_end_pressed_(false), | 208 delete_at_end_pressed_(false), |
| 209 handling_key_press_(false), | 209 handling_key_press_(false), |
| 210 content_maybe_changed_by_key_press_(false), | 210 content_maybe_changed_by_key_press_(false), |
| (...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2394 | 2394 |
| 2395 // Make all the children of the widget visible. NOTE: this won't display | 2395 // Make all the children of the widget visible. NOTE: this won't display |
| 2396 // anything, it just toggles the visible flag. | 2396 // anything, it just toggles the visible flag. |
| 2397 gtk_widget_show_all(omnibox_view->GetNativeView()); | 2397 gtk_widget_show_all(omnibox_view->GetNativeView()); |
| 2398 // Hide the widget. NativeViewHostGtk will make it visible again as necessary. | 2398 // Hide the widget. NativeViewHostGtk will make it visible again as necessary. |
| 2399 gtk_widget_hide(omnibox_view->GetNativeView()); | 2399 gtk_widget_hide(omnibox_view->GetNativeView()); |
| 2400 | 2400 |
| 2401 return omnibox_view; | 2401 return omnibox_view; |
| 2402 } | 2402 } |
| 2403 #endif | 2403 #endif |
| OLD | NEW |