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 // For WinDDK ATL compatibility, these ATL headers must come first. | 5 // For WinDDK ATL compatibility, these ATL headers must come first. |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <atlbase.h> // NOLINT | 8 #include <atlbase.h> // NOLINT |
9 #include <atlwin.h> // NOLINT | 9 #include <atlwin.h> // NOLINT |
10 #endif | 10 #endif |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 AutocompleteResultView::AutocompleteResultView( | 109 AutocompleteResultView::AutocompleteResultView( |
110 AutocompleteResultViewModel* model, | 110 AutocompleteResultViewModel* model, |
111 int model_index, | 111 int model_index, |
112 const gfx::Font& font, | 112 const gfx::Font& font, |
113 const gfx::Font& bold_font) | 113 const gfx::Font& bold_font) |
114 : model_(model), | 114 : model_(model), |
115 model_index_(model_index), | 115 model_index_(model_index), |
116 normal_font_(font), | 116 normal_font_(font), |
117 bold_font_(bold_font), | 117 bold_font_(bold_font), |
118 ellipsis_width_(font.GetStringWidth(string16(kEllipsis))), | 118 ellipsis_width_(font.GetStringWidth(string16(kEllipsis))), |
119 mirroring_context_(new MirroringContext()), | 119 mirroring_context_(new MirroringContext()) { |
120 match_(NULL, 0, false, AutocompleteMatch::URL_WHAT_YOU_TYPED) { | |
121 CHECK_GE(model_index, 0); | 120 CHECK_GE(model_index, 0); |
122 if (default_icon_size_ == 0) { | 121 if (default_icon_size_ == 0) { |
123 default_icon_size_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 122 default_icon_size_ = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
124 AutocompleteMatch::TypeToIcon(AutocompleteMatch::URL_WHAT_YOU_TYPED))-> | 123 AutocompleteMatch::TypeToIcon(AutocompleteMatch::URL_WHAT_YOU_TYPED))-> |
125 width(); | 124 width(); |
126 } | 125 } |
127 } | 126 } |
128 | 127 |
129 AutocompleteResultView::~AutocompleteResultView() { | 128 AutocompleteResultView::~AutocompleteResultView() { |
130 } | 129 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 | 520 |
522 // Paint the icon. | 521 // Paint the icon. |
523 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), | 522 canvas->DrawBitmapInt(*GetIcon(), GetMirroredXForRect(icon_bounds_), |
524 icon_bounds_.y()); | 523 icon_bounds_.y()); |
525 | 524 |
526 // Paint the text. | 525 // Paint the text. |
527 int x = GetMirroredXForRect(text_bounds_); | 526 int x = GetMirroredXForRect(text_bounds_); |
528 mirroring_context_->Initialize(x, text_bounds_.width()); | 527 mirroring_context_->Initialize(x, text_bounds_.width()); |
529 PaintMatch(canvas, match_, x); | 528 PaintMatch(canvas, match_, x); |
530 } | 529 } |
OLD | NEW |