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 <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // Note: We force to URL to LTR for all text directions. | 481 // Note: We force to URL to LTR for all text directions. |
482 SetupLayoutForMatch(layout_, match.contents, match.contents_class, | 482 SetupLayoutForMatch(layout_, match.contents, match.contents_class, |
483 &kContentTextColor, std::string()); | 483 &kContentTextColor, std::string()); |
484 | 484 |
485 int actual_content_width, actual_content_height; | 485 int actual_content_width, actual_content_height; |
486 pango_layout_get_size(layout_, | 486 pango_layout_get_size(layout_, |
487 &actual_content_width, &actual_content_height); | 487 &actual_content_width, &actual_content_height); |
488 actual_content_width /= PANGO_SCALE; | 488 actual_content_width /= PANGO_SCALE; |
489 actual_content_height /= PANGO_SCALE; | 489 actual_content_height /= PANGO_SCALE; |
490 | 490 |
491 DCHECK_LT(actual_content_height, kHeightPerResult); // Font is too tall. | 491 //DCHECK_LT(actual_content_height, kHeightPerResult); // Font is too tall. |
492 // Center the text within the line. | 492 // Center the text within the line. |
493 int content_y = std::max(line_rect.y(), | 493 int content_y = std::max(line_rect.y(), |
494 line_rect.y() + ((kHeightPerResult - actual_content_height) / 2)); | 494 line_rect.y() + ((kHeightPerResult - actual_content_height) / 2)); |
495 | 495 |
496 gdk_draw_layout(drawable, gc, | 496 gdk_draw_layout(drawable, gc, |
497 ltr ? kIconAreaWidth : text_width - actual_content_width, | 497 ltr ? kIconAreaWidth : text_width - actual_content_width, |
498 content_y, layout_); | 498 content_y, layout_); |
499 | 499 |
500 if (has_description) { | 500 if (has_description) { |
501 pango_layout_set_width(layout_, | 501 pango_layout_set_width(layout_, |
(...skipping 20 matching lines...) Expand all Loading... |
522 // static | 522 // static |
523 AutocompletePopupView* AutocompletePopupView::CreatePopupView( | 523 AutocompletePopupView* AutocompletePopupView::CreatePopupView( |
524 const gfx::Font& font, | 524 const gfx::Font& font, |
525 AutocompleteEditView* edit_view, | 525 AutocompleteEditView* edit_view, |
526 AutocompleteEditModel* edit_model, | 526 AutocompleteEditModel* edit_model, |
527 Profile* profile, | 527 Profile* profile, |
528 const BubblePositioner* bubble_positioner) { | 528 const BubblePositioner* bubble_positioner) { |
529 return new AutocompletePopupViewGtk(edit_view, edit_model, profile, | 529 return new AutocompletePopupViewGtk(edit_view, edit_model, profile, |
530 bubble_positioner); | 530 bubble_positioner); |
531 } | 531 } |
OLD | NEW |