| 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/views/autocomplete/autocomplete_popup_contents_view.
h" | 5 #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.
h" |
| 6 | 6 |
| 7 #include "app/bidi_line_iterator.h" | 7 #include "app/bidi_line_iterator.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "app/theme_provider.h" | 10 #include "app/theme_provider.h" |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 const bool reverse_visible_order = (i->is_rtl != base::i18n::IsRTL()); | 664 const bool reverse_visible_order = (i->is_rtl != base::i18n::IsRTL()); |
| 665 int flags = gfx::Canvas::NO_ELLIPSIS; // We've already elided. | 665 int flags = gfx::Canvas::NO_ELLIPSIS; // We've already elided. |
| 666 if (reverse_visible_order) { | 666 if (reverse_visible_order) { |
| 667 std::reverse(i->classifications.begin(), i->classifications.end()); | 667 std::reverse(i->classifications.begin(), i->classifications.end()); |
| 668 if (i->is_rtl) | 668 if (i->is_rtl) |
| 669 flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY; | 669 flags |= gfx::Canvas::FORCE_RTL_DIRECTIONALITY; |
| 670 } | 670 } |
| 671 for (Classifications::const_iterator j(i->classifications.begin()); | 671 for (Classifications::const_iterator j(i->classifications.begin()); |
| 672 j != i->classifications.end(); ++j) { | 672 j != i->classifications.end(); ++j) { |
| 673 int left = mirroring_context_->mirrored_left_coord(x, x + j->pixel_width); | 673 int left = mirroring_context_->mirrored_left_coord(x, x + j->pixel_width); |
| 674 canvas->DrawStringInt(WideToUTF16Hack(j->text), *j->font, j->color, left, | 674 canvas->DrawStringInt(j->text, *j->font, j->color, left, y, |
| 675 y, j->pixel_width, j->font->GetHeight(), flags); | 675 j->pixel_width, j->font->GetHeight(), flags); |
| 676 x += j->pixel_width; | 676 x += j->pixel_width; |
| 677 } | 677 } |
| 678 } | 678 } |
| 679 | 679 |
| 680 return x; | 680 return x; |
| 681 } | 681 } |
| 682 | 682 |
| 683 void AutocompleteResultView::Elide(Runs* runs, int remaining_width) const { | 683 void AutocompleteResultView::Elide(Runs* runs, int remaining_width) const { |
| 684 // The complexity of this function is due to edge cases like the following: | 684 // The complexity of this function is due to edge cases like the following: |
| 685 // We have 100 px of available space, an initial classification that takes 86 | 685 // We have 100 px of available space, an initial classification that takes 86 |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 opt_in_view_ = NULL; | 1204 opt_in_view_ = NULL; |
| 1205 PromoCounter* counter = model_->profile()->GetInstantPromoCounter(); | 1205 PromoCounter* counter = model_->profile()->GetInstantPromoCounter(); |
| 1206 DCHECK(counter); | 1206 DCHECK(counter); |
| 1207 counter->Hide(); | 1207 counter->Hide(); |
| 1208 if (opt_in) { | 1208 if (opt_in) { |
| 1209 browser::ShowInstantConfirmDialogIfNecessary( | 1209 browser::ShowInstantConfirmDialogIfNecessary( |
| 1210 location_bar_->GetWindow()->GetNativeWindow(), model_->profile()); | 1210 location_bar_->GetWindow()->GetNativeWindow(), model_->profile()); |
| 1211 } | 1211 } |
| 1212 UpdatePopupAppearance(); | 1212 UpdatePopupAppearance(); |
| 1213 } | 1213 } |
| OLD | NEW |