| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/table/table_view.h" | 5 #include "views/controls/table/table_view.h" |
| 6 | 6 |
| 7 #include <commctrl.h> | 7 #include <commctrl.h> |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1255 // NOTE: This may be invoked without the ListView filling in the | 1255 // NOTE: This may be invoked without the ListView filling in the |
| 1256 // background (or rather windows paints background, then invokes | 1256 // background (or rather windows paints background, then invokes |
| 1257 // this twice). As such, we always fill in the background. | 1257 // this twice). As such, we always fill in the background. |
| 1258 canvas.drawColor( | 1258 canvas.drawColor( |
| 1259 skia::COLORREFToSkColor(GetSysColor(bg_color_index)), | 1259 skia::COLORREFToSkColor(GetSysColor(bg_color_index)), |
| 1260 SkXfermode::kSrc_Mode); | 1260 SkXfermode::kSrc_Mode); |
| 1261 // + 1 for padding (we declared the image as 18x18 in the list- | 1261 // + 1 for padding (we declared the image as 18x18 in the list- |
| 1262 // view when they are 16x16 so we get an extra pixel of padding). | 1262 // view when they are 16x16 so we get an extra pixel of padding). |
| 1263 canvas.DrawBitmapInt(image, 0, 0, | 1263 canvas.DrawBitmapInt(image, 0, 0, |
| 1264 image.width(), image.height(), | 1264 image.width(), image.height(), |
| 1265 1, 1, kFavIconSize, kFavIconSize, true); | 1265 1, 1, kFaviconSize, kFaviconSize, true); |
| 1266 | 1266 |
| 1267 // Only paint the visible region of the icon. | 1267 // Only paint the visible region of the icon. |
| 1268 RECT to_draw = { intersection.left - icon_rect.left, | 1268 RECT to_draw = { intersection.left - icon_rect.left, |
| 1269 intersection.top - icon_rect.top, | 1269 intersection.top - icon_rect.top, |
| 1270 0, 0 }; | 1270 0, 0 }; |
| 1271 to_draw.right = to_draw.left + | 1271 to_draw.right = to_draw.left + |
| 1272 (intersection.right - intersection.left); | 1272 (intersection.right - intersection.left); |
| 1273 to_draw.bottom = to_draw.top + | 1273 to_draw.bottom = to_draw.top + |
| 1274 (intersection.bottom - intersection.top); | 1274 (intersection.bottom - intersection.top); |
| 1275 canvas.getTopPlatformDevice().drawToHDC(draw_info->nmcd.hdc, | 1275 canvas.getTopPlatformDevice().drawToHDC(draw_info->nmcd.hdc, |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1635 } | 1635 } |
| 1636 | 1636 |
| 1637 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { | 1637 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { |
| 1638 if (view_index_ == -1) | 1638 if (view_index_ == -1) |
| 1639 model_index_ = -1; | 1639 model_index_ = -1; |
| 1640 else | 1640 else |
| 1641 model_index_ = table_view_->ViewToModel(view_index_); | 1641 model_index_ = table_view_->ViewToModel(view_index_); |
| 1642 } | 1642 } |
| 1643 | 1643 |
| 1644 } // namespace views | 1644 } // namespace views |
| OLD | NEW |