OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/autocomplete/autocomplete_popup_view_gtk.h" | 5 #include "chrome/browser/autocomplete/autocomplete_popup_view_gtk.h" |
6 | 6 |
| 7 #include "base/gfx/gtk_util.h" |
7 #include "base/logging.h" | 8 #include "base/logging.h" |
8 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
9 #include "base/string_util.h" | 10 #include "base/string_util.h" |
10 #include "chrome/browser/autocomplete/autocomplete.h" | 11 #include "chrome/browser/autocomplete/autocomplete.h" |
11 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 12 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
12 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 13 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
13 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 14 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
14 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
15 #include "chrome/browser/search_engines/template_url.h" | 16 #include "chrome/browser/search_engines/template_url.h" |
16 #include "chrome/browser/search_engines/template_url_model.h" | 17 #include "chrome/browser/search_engines/template_url_model.h" |
17 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 const GdkColor kPopupBorderColor = {0, 51143, 51914, 52942}; // #c7cace | 22 const GdkColor kPopupBorderColor = GDK_COLOR_RGB(0xc7, 0xca, 0xce); |
22 const GdkColor kPopupBackground = {0, 65535, 65535, 65535}; // #ffffff | 23 const GdkColor kPopupBackground = GDK_COLOR_RGB(0xff, 0xff, 0xff); |
23 const GdkColor kHighlightColor = {0, 49601, 51400, 55769}; // #c1c8d9 | 24 const GdkColor kHighlightColor = GDK_COLOR_RGB(0xc1, 0xc8, 0xd9); |
24 | 25 |
25 } // namespace | 26 } // namespace |
26 | 27 |
27 AutocompletePopupViewGtk::AutocompletePopupViewGtk( | 28 AutocompletePopupViewGtk::AutocompletePopupViewGtk( |
28 AutocompleteEditViewGtk* edit_view, | 29 AutocompleteEditViewGtk* edit_view, |
29 AutocompleteEditModel* edit_model, | 30 AutocompleteEditModel* edit_model, |
30 Profile* profile) | 31 Profile* profile) |
31 : model_(new AutocompletePopupModel(this, edit_model, profile)), | 32 : model_(new AutocompletePopupModel(this, edit_model, profile)), |
32 edit_view_(edit_view), | 33 edit_view_(edit_view), |
33 window_(gtk_window_new(GTK_WINDOW_POPUP)), | 34 window_(gtk_window_new(GTK_WINDOW_POPUP)), |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 gtk_window_move(GTK_WINDOW(window_), x, y); | 107 gtk_window_move(GTK_WINDOW(window_), x, y); |
107 gtk_widget_set_size_request(window_, width, -1); | 108 gtk_widget_set_size_request(window_, width, -1); |
108 gtk_widget_show(window_); | 109 gtk_widget_show(window_); |
109 opened_ = true; | 110 opened_ = true; |
110 } | 111 } |
111 | 112 |
112 void AutocompletePopupViewGtk::Hide() { | 113 void AutocompletePopupViewGtk::Hide() { |
113 gtk_widget_hide(window_); | 114 gtk_widget_hide(window_); |
114 opened_ = false; | 115 opened_ = false; |
115 } | 116 } |
OLD | NEW |