Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: ui/views/controls/menu/native_menu_win.cc

Issue 10790128: Revert 147915 - Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/glow_hover_controller.cc ('k') | ui/views/controls/table/table_view_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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,
285 false); 284 false);
286 NativeTheme::ExtraParams extra; 285 NativeTheme::ExtraParams extra;
287 extra.menu_check.is_radio = false; 286 extra.menu_check.is_radio = false;
288 gfx::Rect bounds(0, 0, config.check_width, config.check_height); 287 gfx::Rect bounds(0, 0, config.check_width, config.check_height);
289 288
290 // Draw the background and the check. 289 // Draw the background and the check.
291 NativeTheme::instance()->Paint( 290 NativeTheme::instance()->Paint(
292 canvas.sk_canvas(), NativeTheme::kMenuCheckBackground, 291 canvas.sk_canvas(), NativeTheme::kMenuCheckBackground,
293 state, bounds, extra); 292 state, bounds, extra);
294 NativeTheme::instance()->Paint( 293 NativeTheme::instance()->Paint(
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 749
751 //////////////////////////////////////////////////////////////////////////////// 750 ////////////////////////////////////////////////////////////////////////////////
752 // MenuWrapper, public: 751 // MenuWrapper, public:
753 752
754 // static 753 // static
755 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) { 754 MenuWrapper* MenuWrapper::CreateWrapper(ui::MenuModel* model) {
756 return new NativeMenuWin(model, NULL); 755 return new NativeMenuWin(model, NULL);
757 } 756 }
758 757
759 } // namespace views 758 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/glow_hover_controller.cc ('k') | ui/views/controls/table/table_view_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698