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

Side by Side Diff: views/controls/menu/menu_win.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 7 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/gfx/native_theme_win.cc ('k') | views/controls/menu/native_menu_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) 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/menu/menu_win.h" 5 #include "views/controls/menu/menu_win.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 static_cast<int>(accel.size()), &rect, 181 static_cast<int>(accel.size()), &rect,
182 format | DT_RIGHT, NULL); 182 format | DT_RIGHT, NULL);
183 SelectObject(hDC, old_font); 183 SelectObject(hDC, old_font);
184 184
185 // Draw the icon after the label, otherwise it would be covered 185 // Draw the icon after the label, otherwise it would be covered
186 // by the label. 186 // by the label.
187 if (data->icon.width() != 0 && data->icon.height() != 0) { 187 if (data->icon.width() != 0 && data->icon.height() != 0) {
188 gfx::CanvasSkia canvas(data->icon.width(), data->icon.height(), false); 188 gfx::CanvasSkia canvas(data->icon.width(), data->icon.height(), false);
189 canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode); 189 canvas.drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
190 canvas.DrawBitmapInt(data->icon, 0, 0); 190 canvas.DrawBitmapInt(data->icon, 0, 0);
191 canvas.getTopPlatformDevice().drawToHDC(hDC, lpdis->rcItem.left + 191 skia::DrawToNativeContext(
192 kItemLeftMargin, lpdis->rcItem.top + (lpdis->rcItem.bottom - 192 &canvas, hDC, lpdis->rcItem.left + kItemLeftMargin,
193 lpdis->rcItem.top - data->icon.height()) / 2, NULL); 193 lpdis->rcItem.top + (lpdis->rcItem.bottom - lpdis->rcItem.top -
194 data->icon.height()) / 2, NULL);
194 } 195 }
195 196
196 } else { 197 } else {
197 // Draw the separator 198 // Draw the separator
198 lpdis->rcItem.top += (lpdis->rcItem.bottom - lpdis->rcItem.top) / 3; 199 lpdis->rcItem.top += (lpdis->rcItem.bottom - lpdis->rcItem.top) / 3;
199 DrawEdge(hDC, &lpdis->rcItem, EDGE_ETCHED, BF_TOP); 200 DrawEdge(hDC, &lpdis->rcItem, EDGE_ETCHED, BF_TOP);
200 } 201 }
201 202
202 SetBkColor(hDC, prev_bg_color); 203 SetBkColor(hDC, prev_bg_color);
203 SetTextColor(hDC, prev_text_color); 204 SetTextColor(hDC, prev_text_color);
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 break; 567 break;
567 568
568 default: 569 default:
569 NOTREACHED(); 570 NOTREACHED();
570 return 0; 571 return 0;
571 } 572 }
572 return align_flags; 573 return align_flags;
573 } 574 }
574 575
575 } // namespace views 576 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/native_theme_win.cc ('k') | views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698