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

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

Issue 8297006: Remove some unused temps. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 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 | « no previous file | 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) 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/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.h" 10 #include "base/stl_util.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 rect.right -= kItemRightMargin; 153 rect.right -= kItemRightMargin;
154 UINT format = DT_TOP | DT_SINGLELINE; 154 UINT format = DT_TOP | DT_SINGLELINE;
155 // Check whether the mnemonics should be underlined. 155 // Check whether the mnemonics should be underlined.
156 BOOL underline_mnemonics; 156 BOOL underline_mnemonics;
157 SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &underline_mnemonics, 0); 157 SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &underline_mnemonics, 0);
158 if (!underline_mnemonics) 158 if (!underline_mnemonics)
159 format |= DT_HIDEPREFIX; 159 format |= DT_HIDEPREFIX;
160 gfx::Font font; 160 gfx::Font font;
161 HGDIOBJ old_font = 161 HGDIOBJ old_font =
162 static_cast<HFONT>(SelectObject(hDC, font.GetNativeFont())); 162 static_cast<HFONT>(SelectObject(hDC, font.GetNativeFont()));
163 int fontsize = font.GetFontSize();
164 163
165 // If an accelerator is specified (with a tab delimiting the rest of the 164 // If an accelerator is specified (with a tab delimiting the rest of the
166 // label from the accelerator), we have to justify the fist part on the 165 // label from the accelerator), we have to justify the fist part on the
167 // left and the accelerator on the right. 166 // left and the accelerator on the right.
168 // TODO(jungshik): This will break in RTL UI. Currently, he/ar use the 167 // TODO(jungshik): This will break in RTL UI. Currently, he/ar use the
169 // window system UI font and will not hit here. 168 // window system UI font and will not hit here.
170 std::wstring label = data->label; 169 std::wstring label = data->label;
171 std::wstring accel; 170 std::wstring accel;
172 std::wstring::size_type tab_pos = label.find(L'\t'); 171 std::wstring::size_type tab_pos = label.find(L'\t');
173 if (tab_pos != std::wstring::npos) { 172 if (tab_pos != std::wstring::npos) {
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 break; 566 break;
568 567
569 default: 568 default:
570 NOTREACHED(); 569 NOTREACHED();
571 return 0; 570 return 0;
572 } 571 }
573 return align_flags; 572 return align_flags;
574 } 573 }
575 574
576 } // namespace views 575 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698