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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/win/hwnd_util.h ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/hwnd_util.cc
diff --git a/ui/base/win/hwnd_util.cc b/ui/base/win/hwnd_util.cc
index 923c85cbf4de24f3a41d693cce7267a59da9ecfe..58dbff2d02bb28393467978afde1aaefe70ef4e3 100644
--- a/ui/base/win/hwnd_util.cc
+++ b/ui/base/win/hwnd_util.cc
@@ -4,6 +4,7 @@
#include "ui/base/win/hwnd_util.h"
+#include "base/i18n/rtl.h"
#include "base/string_util.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
@@ -174,4 +175,15 @@ void CheckWindowCreated(HWND hwnd) {
LOG_GETLASTERROR(FATAL);
}
+void ShowSystemMenu(HWND window, int screen_x, int screen_y) {
+ UINT flags = TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD;
+ if (base::i18n::IsRTL())
+ flags |= TPM_RIGHTALIGN;
+ HMENU system_menu = GetSystemMenu(window, FALSE);
+ int command = TrackPopupMenu(system_menu, flags, screen_x, screen_y, 0,
+ window, NULL);
+ if (command)
+ SendMessage(window, WM_SYSCOMMAND, command, 0);
+}
+
} // namespace ui
« 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