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

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

Issue 10701063: Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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,
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
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
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