OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/menu/native_menu_win.h" | 5 #include "ui/views/controls/menu/native_menu_win.h" |
6 | 6 |
7 #include <Windowsx.h> | 7 #include <Windowsx.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 } else { | 274 } else { |
275 state = draw_item_struct->itemState & ODS_SELECTED ? | 275 state = draw_item_struct->itemState & ODS_SELECTED ? |
276 NativeTheme::kHovered : NativeTheme::kNormal; | 276 NativeTheme::kHovered : NativeTheme::kNormal; |
277 } | 277 } |
278 int height = | 278 int height = |
279 draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top; | 279 draw_item_struct->rcItem.bottom - draw_item_struct->rcItem.top; |
280 int icon_y = kItemTopMargin + | 280 int icon_y = kItemTopMargin + |
281 (height - kItemTopMargin - kItemBottomMargin - | 281 (height - kItemTopMargin - kItemBottomMargin - |
282 config.check_height) / 2; | 282 config.check_height) / 2; |
283 gfx::Canvas canvas(gfx::Size(config.check_width, config.check_height), | 283 gfx::Canvas canvas(gfx::Size(config.check_width, config.check_height), |
| 284 ui::SCALE_FACTOR_100P, |
284 false); | 285 false); |
285 NativeTheme::ExtraParams extra; | 286 NativeTheme::ExtraParams extra; |
286 extra.menu_check.is_radio = false; | 287 extra.menu_check.is_radio = false; |
287 gfx::Rect bounds(0, 0, config.check_width, config.check_height); | 288 gfx::Rect bounds(0, 0, config.check_width, config.check_height); |
288 | 289 |
289 // Draw the background and the check. | 290 // Draw the background and the check. |
290 NativeTheme::instance()->Paint( | 291 NativeTheme::instance()->Paint( |
291 canvas.sk_canvas(), NativeTheme::kMenuCheckBackground, | 292 canvas.sk_canvas(), NativeTheme::kMenuCheckBackground, |
292 state, bounds, extra); | 293 state, bounds, extra); |
293 NativeTheme::instance()->Paint( | 294 NativeTheme::instance()->Paint( |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 | 750 |
750 //////////////////////////////////////////////////////////////////////////////// | 751 //////////////////////////////////////////////////////////////////////////////// |
751 // MenuWrapper, public: | 752 // MenuWrapper, public: |
752 | 753 |
753 // static | 754 // static |
754 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { | 755 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { |
755 return new NativeMenuWin(model, NULL); | 756 return new NativeMenuWin(model, NULL); |
756 } | 757 } |
757 | 758 |
758 } // namespace views | 759 } // namespace views |
OLD | NEW |