| 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/i18n/bidi_line_iterator.h" | 8 #include "base/i18n/bidi_line_iterator.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 AutocompleteResultView::~AutocompleteResultView() { | 436 AutocompleteResultView::~AutocompleteResultView() { |
| 437 } | 437 } |
| 438 | 438 |
| 439 void AutocompleteResultView::Paint(gfx::Canvas* canvas) { | 439 void AutocompleteResultView::Paint(gfx::Canvas* canvas) { |
| 440 const ResultViewState state = GetState(); | 440 const ResultViewState state = GetState(); |
| 441 if (state != NORMAL) | 441 if (state != NORMAL) |
| 442 canvas->AsCanvasSkia()->drawColor(GetColor(state, BACKGROUND)); | 442 canvas->AsCanvasSkia()->drawColor(GetColor(state, BACKGROUND)); |
| 443 | 443 |
| 444 // Paint the icon. | 444 // Paint the icon. |
| 445 canvas->DrawBitmapInt(*GetIcon(), MirroredLeftPointForRect(icon_bounds_), | 445 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), |
| 446 icon_bounds_.y()); | 446 icon_bounds_.y()); |
| 447 | 447 |
| 448 // Paint the text. | 448 // Paint the text. |
| 449 int x = MirroredLeftPointForRect(text_bounds_); | 449 int x = GetMirroredXForRect(text_bounds_); |
| 450 mirroring_context_->Initialize(x, text_bounds_.width()); | 450 mirroring_context_->Initialize(x, text_bounds_.width()); |
| 451 x = DrawString(canvas, match_.contents, match_.contents_class, false, x, | 451 x = DrawString(canvas, match_.contents, match_.contents_class, false, x, |
| 452 text_bounds_.y()); | 452 text_bounds_.y()); |
| 453 | 453 |
| 454 // Paint the description. | 454 // Paint the description. |
| 455 // TODO(pkasting): Because we paint in multiple separate pieces, we can wind | 455 // TODO(pkasting): Because we paint in multiple separate pieces, we can wind |
| 456 // up with no space even for an ellipsis for one or both of these pieces. | 456 // up with no space even for an ellipsis for one or both of these pieces. |
| 457 // Instead, we should paint the entire match as a single long string. This | 457 // Instead, we should paint the entire match as a single long string. This |
| 458 // would also let us use a more properly-localizable string than we get with | 458 // would also let us use a more properly-localizable string than we get with |
| 459 // just the IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR. | 459 // just the IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR. |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 opt_in_view_ = NULL; | 1201 opt_in_view_ = NULL; |
| 1202 PromoCounter* counter = model_->profile()->GetInstantPromoCounter(); | 1202 PromoCounter* counter = model_->profile()->GetInstantPromoCounter(); |
| 1203 DCHECK(counter); | 1203 DCHECK(counter); |
| 1204 counter->Hide(); | 1204 counter->Hide(); |
| 1205 if (opt_in) { | 1205 if (opt_in) { |
| 1206 browser::ShowInstantConfirmDialogIfNecessary( | 1206 browser::ShowInstantConfirmDialogIfNecessary( |
| 1207 location_bar_->GetWindow()->GetNativeWindow(), model_->profile()); | 1207 location_bar_->GetWindow()->GetNativeWindow(), model_->profile()); |
| 1208 } | 1208 } |
| 1209 UpdatePopupAppearance(); | 1209 UpdatePopupAppearance(); |
| 1210 } | 1210 } |
| OLD | NEW |