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

Side by Side Diff: ui/base/win/hwnd_util.cc

Issue 7237032: Changes wrench menu button to show system menu on space. This matches (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweak comment Created 9 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/base/win/hwnd_util.h ('k') | views/widget/native_widget_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 "ui/base/win/hwnd_util.h" 5 #include "ui/base/win/hwnd_util.h"
6 6
7 #include "base/i18n/rtl.h"
7 #include "base/string_util.h" 8 #include "base/string_util.h"
8 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
9 #include "ui/gfx/size.h" 10 #include "ui/gfx/size.h"
10 11
11 namespace ui { 12 namespace ui {
12 13
13 namespace { 14 namespace {
14 15
15 // Adjust the window to fit, returning true if the window was resized or moved. 16 // Adjust the window to fit, returning true if the window was resized or moved.
16 bool AdjustWindowToFit(HWND hwnd, const RECT& bounds) { 17 bool AdjustWindowToFit(HWND hwnd, const RECT& bounds) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } else { 168 } else {
168 NOTREACHED() << "Unable to adjust window to fit"; 169 NOTREACHED() << "Unable to adjust window to fit";
169 } 170 }
170 } 171 }
171 172
172 void CheckWindowCreated(HWND hwnd) { 173 void CheckWindowCreated(HWND hwnd) {
173 if (!hwnd) 174 if (!hwnd)
174 LOG_GETLASTERROR(FATAL); 175 LOG_GETLASTERROR(FATAL);
175 } 176 }
176 177
178 void ShowSystemMenu(HWND window, int screen_x, int screen_y) {
179 UINT flags = TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD;
180 if (base::i18n::IsRTL())
181 flags |= TPM_RIGHTALIGN;
182 HMENU system_menu = GetSystemMenu(window, FALSE);
183 int command = TrackPopupMenu(system_menu, flags, screen_x, screen_y, 0,
184 window, NULL);
185 if (command)
186 SendMessage(window, WM_SYSCOMMAND, command, 0);
187 }
188
177 } // namespace ui 189 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/win/hwnd_util.h ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698