OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // This is because the model destructor can call back into us, and we need | 330 // This is because the model destructor can call back into us, and we need |
331 // to make sure everything is still valid when it does. | 331 // to make sure everything is still valid when it does. |
332 model_.reset(); | 332 model_.reset(); |
333 g_object_unref(layout_); | 333 g_object_unref(layout_); |
334 gtk_widget_destroy(window_); | 334 gtk_widget_destroy(window_); |
335 | 335 |
336 for (PixbufMap::iterator it = pixbufs_.begin(); it != pixbufs_.end(); ++it) | 336 for (PixbufMap::iterator it = pixbufs_.begin(); it != pixbufs_.end(); ++it) |
337 g_object_unref(it->second); | 337 g_object_unref(it->second); |
338 } | 338 } |
339 | 339 |
| 340 bool AutocompletePopupViewGtk::IsOpen() const { |
| 341 return opened_; |
| 342 } |
| 343 |
340 void AutocompletePopupViewGtk::InvalidateLine(size_t line) { | 344 void AutocompletePopupViewGtk::InvalidateLine(size_t line) { |
341 // TODO(deanm): Is it possible to use some constant for the width, instead | 345 // TODO(deanm): Is it possible to use some constant for the width, instead |
342 // of having to query the width of the window? | 346 // of having to query the width of the window? |
343 GdkRectangle line_rect = GetRectForLine( | 347 GdkRectangle line_rect = GetRectForLine( |
344 line, GetWindowRect(window_->window).width()).ToGdkRectangle(); | 348 line, GetWindowRect(window_->window).width()).ToGdkRectangle(); |
345 gdk_window_invalidate_rect(window_->window, &line_rect, FALSE); | 349 gdk_window_invalidate_rect(window_->window, &line_rect, FALSE); |
346 } | 350 } |
347 | 351 |
348 void AutocompletePopupViewGtk::UpdatePopupAppearance() { | 352 void AutocompletePopupViewGtk::UpdatePopupAppearance() { |
349 const AutocompleteResult& result = model_->result(); | 353 const AutocompleteResult& result = model_->result(); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 (text_width - actual_content_width - | 666 (text_width - actual_content_width - |
663 (actual_description_width / PANGO_SCALE)), | 667 (actual_description_width / PANGO_SCALE)), |
664 content_y, layout_); | 668 content_y, layout_); |
665 } | 669 } |
666 } | 670 } |
667 | 671 |
668 g_object_unref(gc); | 672 g_object_unref(gc); |
669 | 673 |
670 return TRUE; | 674 return TRUE; |
671 } | 675 } |
OLD | NEW |