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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 is_url = false; | 552 is_url = false; |
553 break; | 553 break; |
554 } | 554 } |
555 } | 555 } |
556 | 556 |
557 // Split the text into visual runs. We do this first so that we don't need to | 557 // Split the text into visual runs. We do this first so that we don't need to |
558 // worry about whether our eliding might change the visual display in | 558 // worry about whether our eliding might change the visual display in |
559 // unintended ways, e.g. by removing directional markings or by adding an | 559 // unintended ways, e.g. by removing directional markings or by adding an |
560 // ellipsis that's not enclosed in appropriate markings. | 560 // ellipsis that's not enclosed in appropriate markings. |
561 BiDiLineIterator bidi_line; | 561 BiDiLineIterator bidi_line; |
562 if (!bidi_line.Open(text, base::i18n::IsRTL(), is_url)) | 562 if (!bidi_line.Open(WideToUTF16Hack(text), base::i18n::IsRTL(), is_url)) |
563 return x; | 563 return x; |
564 const int num_runs = bidi_line.CountRuns(); | 564 const int num_runs = bidi_line.CountRuns(); |
565 Runs runs; | 565 Runs runs; |
566 for (int run = 0; run < num_runs; ++run) { | 566 for (int run = 0; run < num_runs; ++run) { |
567 int run_start_int = 0, run_length_int = 0; | 567 int run_start_int = 0, run_length_int = 0; |
568 // The index we pass to GetVisualRun corresponds to the position of the run | 568 // The index we pass to GetVisualRun corresponds to the position of the run |
569 // in the displayed text. For example, the string "Google in HEBREW" (where | 569 // in the displayed text. For example, the string "Google in HEBREW" (where |
570 // HEBREW is text in the Hebrew language) has two runs: "Google in " which | 570 // HEBREW is text in the Hebrew language) has two runs: "Google in " which |
571 // is an LTR run, and "HEBREW" which is an RTL run. In an LTR context, the | 571 // is an LTR run, and "HEBREW" which is an RTL run. In an LTR context, the |
572 // run "Google in " has the index 0 (since it is the leftmost run | 572 // run "Google in " has the index 0 (since it is the leftmost run |
(...skipping 631 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 |