| 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 <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/gfx/gtk_util.h" | 10 #include "base/gfx/gtk_util.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 gtk_widget_hide(window_); | 195 gtk_widget_hide(window_); |
| 196 opened_ = false; | 196 opened_ = false; |
| 197 } | 197 } |
| 198 | 198 |
| 199 gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, | 199 gboolean AutocompletePopupViewGtk::HandleExpose(GtkWidget* widget, |
| 200 GdkEventExpose* event) { | 200 GdkEventExpose* event) { |
| 201 const AutocompleteResult& result = model_->result(); | 201 const AutocompleteResult& result = model_->result(); |
| 202 | 202 |
| 203 // TODO(deanm): These would be better as pixmaps someday. | 203 // TODO(deanm): These would be better as pixmaps someday. |
| 204 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 204 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 205 static GdkPixbuf* o2_globe = rb.LoadPixbuf(IDR_O2_GLOBE); | 205 static GdkPixbuf* o2_globe = rb.GetPixbufNamed(IDR_O2_GLOBE); |
| 206 static GdkPixbuf* o2_history = rb.LoadPixbuf(IDR_O2_HISTORY); | 206 static GdkPixbuf* o2_history = rb.GetPixbufNamed(IDR_O2_HISTORY); |
| 207 static GdkPixbuf* o2_more = rb.LoadPixbuf(IDR_O2_MORE); | 207 static GdkPixbuf* o2_more = rb.GetPixbufNamed(IDR_O2_MORE); |
| 208 static GdkPixbuf* o2_search = rb.LoadPixbuf(IDR_O2_SEARCH); | 208 static GdkPixbuf* o2_search = rb.GetPixbufNamed(IDR_O2_SEARCH); |
| 209 static GdkPixbuf* o2_star = rb.LoadPixbuf(IDR_O2_STAR); | 209 static GdkPixbuf* o2_star = rb.GetPixbufNamed(IDR_O2_STAR); |
| 210 | 210 |
| 211 GdkRectangle window_rect = GetWindowRect(event->window); | 211 GdkRectangle window_rect = GetWindowRect(event->window); |
| 212 // Handle when our window is super narrow. A bunch of the calculations | 212 // Handle when our window is super narrow. A bunch of the calculations |
| 213 // below would go negative, and really we're not going to fit anything | 213 // below would go negative, and really we're not going to fit anything |
| 214 // useful in such a small window anyway. Just don't paint anything. | 214 // useful in such a small window anyway. Just don't paint anything. |
| 215 // This means we won't draw the border, but, yeah, whatever. | 215 // This means we won't draw the border, but, yeah, whatever. |
| 216 // TODO(deanm): Make the code more robust and remove this check. | 216 // TODO(deanm): Make the code more robust and remove this check. |
| 217 if (window_rect.width < (kIconAreaWidth * 3)) | 217 if (window_rect.width < (kIconAreaWidth * 3)) |
| 218 return TRUE; | 218 return TRUE; |
| 219 | 219 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 gdk_draw_layout(drawable, gc, | 318 gdk_draw_layout(drawable, gc, |
| 319 kIconAreaWidth, text_y, | 319 kIconAreaWidth, text_y, |
| 320 layout); | 320 layout); |
| 321 } | 321 } |
| 322 | 322 |
| 323 g_object_unref(gc); | 323 g_object_unref(gc); |
| 324 | 324 |
| 325 return TRUE; | 325 return TRUE; |
| 326 } | 326 } |
| OLD | NEW |