OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 | 4 |
5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" | 5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" |
6 | 6 |
7 #include <objidl.h> | 7 #include <objidl.h> |
8 #include <commctrl.h> | 8 #include <commctrl.h> |
9 #include <dwmapi.h> | 9 #include <dwmapi.h> |
10 | 10 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 AutocompleteResultView::AutocompleteResultView( | 273 AutocompleteResultView::AutocompleteResultView( |
274 AutocompleteResultViewModel* model, | 274 AutocompleteResultViewModel* model, |
275 int model_index, | 275 int model_index, |
276 const gfx::Font& font) | 276 const gfx::Font& font) |
277 : model_(model), | 277 : model_(model), |
278 model_index_(model_index), | 278 model_index_(model_index), |
279 hot_(false), | 279 hot_(false), |
280 font_(font), | 280 font_(font), |
281 mirroring_context_(new MirroringContext()) { | 281 mirroring_context_(new MirroringContext()) { |
| 282 CHECK(model_index >= 0); |
282 InitClass(); | 283 InitClass(); |
283 } | 284 } |
284 | 285 |
285 AutocompleteResultView::~AutocompleteResultView() { | 286 AutocompleteResultView::~AutocompleteResultView() { |
286 } | 287 } |
287 | 288 |
288 void AutocompleteResultView::Paint(gfx::Canvas* canvas) { | 289 void AutocompleteResultView::Paint(gfx::Canvas* canvas) { |
289 canvas->FillRectInt(GetBackgroundColor(), 0, 0, width(), height()); | 290 canvas->FillRectInt(GetBackgroundColor(), 0, 0, width(), height()); |
290 | 291 |
291 int x = MirroredLeftPointForRect(icon_bounds_); | 292 int x = MirroredLeftPointForRect(icon_bounds_); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 // Allow the window blur effect to show through the popup background. | 871 // Allow the window blur effect to show through the popup background. |
871 SkPaint paint; | 872 SkPaint paint; |
872 SkColor transparency = GetThemeProvider()->ShouldUseNativeFrame() ? | 873 SkColor transparency = GetThemeProvider()->ShouldUseNativeFrame() ? |
873 kGlassPopupTransparency : kOpaquePopupTransparency; | 874 kGlassPopupTransparency : kOpaquePopupTransparency; |
874 paint.setColor(SkColorSetARGB(transparency, 255, 255, 255)); | 875 paint.setColor(SkColorSetARGB(transparency, 255, 255, 255)); |
875 paint.setPorterDuffXfermode(SkPorterDuff::kDstIn_Mode); | 876 paint.setPorterDuffXfermode(SkPorterDuff::kDstIn_Mode); |
876 paint.setStyle(SkPaint::kFill_Style); | 877 paint.setStyle(SkPaint::kFill_Style); |
877 canvas->FillRectInt(0, 0, canvas->getDevice()->width(), | 878 canvas->FillRectInt(0, 0, canvas->getDevice()->width(), |
878 canvas->getDevice()->height(), paint); | 879 canvas->getDevice()->height(), paint); |
879 } | 880 } |
OLD | NEW |