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

Unified Diff: ui/gfx/win/hwnd_util.cc

Issue 788883004: Not counting nested loops as time spent in a task (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/hwnd_util.cc
diff --git a/ui/gfx/win/hwnd_util.cc b/ui/gfx/win/hwnd_util.cc
index 41eead48f8d9809b76664cee6d040f27f0efa571..98d71af7ac6641749861ff361fadfe1697354609 100644
--- a/ui/gfx/win/hwnd_util.cc
+++ b/ui/gfx/win/hwnd_util.cc
@@ -6,6 +6,7 @@
#include "base/i18n/rtl.h"
#include "base/strings/string_util.h"
+#include "base/tracked_objects.h"
#include "base/win/metro.h"
#include "base/win/win_util.h"
#include "ui/gfx/point.h"
@@ -222,8 +223,15 @@ void ShowSystemMenuAtPoint(HWND window, const Point& point) {
if (base::i18n::IsRTL())
flags |= TPM_RIGHTALIGN;
HMENU menu = GetSystemMenu(window, FALSE);
+
+ // Use task stopwatch to exclude the time while the context menu is open from
+ // the current task, if any.
+ tracked_objects::TaskStopwatch stopwatch;
+ stopwatch.Start();
const int command =
TrackPopupMenu(menu, flags, point.x(), point.y(), 0, window, NULL);
+ stopwatch.Stop();
+
if (command)
SendMessage(window, WM_SYSCOMMAND, command, 0);
}
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/desktop_drag_drop_client_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698