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 "views/controls/menu/native_menu_win.h" | 5 #include "views/controls/menu/native_menu_win.h" |
6 | 6 |
7 #include <Windowsx.h> | 7 #include <Windowsx.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 format | DT_RIGHT, NULL); | 233 format | DT_RIGHT, NULL); |
234 SelectObject(dc, old_font); | 234 SelectObject(dc, old_font); |
235 | 235 |
236 // Draw the icon after the label, otherwise it would be covered | 236 // Draw the icon after the label, otherwise it would be covered |
237 // by the label. | 237 // by the label. |
238 SkBitmap icon; | 238 SkBitmap icon; |
239 if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) { | 239 if (data->native_menu_win->model_->GetIconAt(data->model_index, &icon)) { |
240 gfx::CanvasSkia canvas(icon.width(), icon.height(), false); | 240 gfx::CanvasSkia canvas(icon.width(), icon.height(), false); |
241 canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); | 241 canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); |
242 canvas.DrawBitmapInt(icon, 0, 0); | 242 canvas.DrawBitmapInt(icon, 0, 0); |
243 canvas.getTopPlatformDevice().drawToHDC(dc, | 243 skia::platform_util::DrawToHDC( |
| 244 &canvas.getTopDevice(), dc, |
244 draw_item_struct->rcItem.left + kItemLeftMargin, | 245 draw_item_struct->rcItem.left + kItemLeftMargin, |
245 draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - | 246 draw_item_struct->rcItem.top + (draw_item_struct->rcItem.bottom - |
246 draw_item_struct->rcItem.top - icon.height()) / 2, NULL); | 247 draw_item_struct->rcItem.top - icon.height()) / 2, NULL); |
247 } | 248 } |
248 | 249 |
249 } else { | 250 } else { |
250 // Draw the separator | 251 // Draw the separator |
251 draw_item_struct->rcItem.top += | 252 draw_item_struct->rcItem.top += |
252 (draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top) / 3; | 253 (draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top) / 3; |
253 DrawEdge(dc, &draw_item_struct->rcItem, EDGE_ETCHED, BF_TOP); | 254 DrawEdge(dc, &draw_item_struct->rcItem, EDGE_ETCHED, BF_TOP); |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | 721 |
721 //////////////////////////////////////////////////////////////////////////////// | 722 //////////////////////////////////////////////////////////////////////////////// |
722 // MenuWrapper, public: | 723 // MenuWrapper, public: |
723 | 724 |
724 // static | 725 // static |
725 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { | 726 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { |
726 return new NativeMenuWin(menu->model(), NULL); | 727 return new NativeMenuWin(menu->model(), NULL); |
727 } | 728 } |
728 | 729 |
729 } // namespace views | 730 } // namespace views |
OLD | NEW |