OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 : model_state(model_state), | 98 : model_state(model_state), |
99 view_state(view_state) { | 99 view_state(view_state) { |
100 } | 100 } |
101 | 101 |
102 const AutocompleteEditModel::State model_state; | 102 const AutocompleteEditModel::State model_state; |
103 const ViewState view_state; | 103 const ViewState view_state; |
104 }; | 104 }; |
105 | 105 |
106 // Returns a lazily initialized property bag accessor for saving our state in a | 106 // Returns a lazily initialized property bag accessor for saving our state in a |
107 // TabContents. | 107 // TabContents. |
108 PropertyAccessor<AutocompleteEditState>* GetStateAccessor() { | 108 base::PropertyAccessor<AutocompleteEditState>* GetStateAccessor() { |
109 CR_DEFINE_STATIC_LOCAL(PropertyAccessor<AutocompleteEditState>, state, ()); | 109 CR_DEFINE_STATIC_LOCAL( |
| 110 base::PropertyAccessor<AutocompleteEditState>, state, ()); |
110 return &state; | 111 return &state; |
111 } | 112 } |
112 | 113 |
113 // Set up style properties to override the default GtkTextView; if a theme has | 114 // Set up style properties to override the default GtkTextView; if a theme has |
114 // overridden some of these properties, an inner-line will be displayed inside | 115 // overridden some of these properties, an inner-line will be displayed inside |
115 // the fake GtkTextEntry. | 116 // the fake GtkTextEntry. |
116 void SetEntryStyle() { | 117 void SetEntryStyle() { |
117 static bool style_was_set = false; | 118 static bool style_was_set = false; |
118 | 119 |
119 if (style_was_set) | 120 if (style_was_set) |
(...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2395 | 2396 |
2396 // Make all the children of the widget visible. NOTE: this won't display | 2397 // Make all the children of the widget visible. NOTE: this won't display |
2397 // anything, it just toggles the visible flag. | 2398 // anything, it just toggles the visible flag. |
2398 gtk_widget_show_all(omnibox_view->GetNativeView()); | 2399 gtk_widget_show_all(omnibox_view->GetNativeView()); |
2399 // Hide the widget. NativeViewHostGtk will make it visible again as necessary. | 2400 // Hide the widget. NativeViewHostGtk will make it visible again as necessary. |
2400 gtk_widget_hide(omnibox_view->GetNativeView()); | 2401 gtk_widget_hide(omnibox_view->GetNativeView()); |
2401 | 2402 |
2402 return omnibox_view; | 2403 return omnibox_view; |
2403 } | 2404 } |
2404 #endif | 2405 #endif |
OLD | NEW |