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

Unified Diff: components/app_modal/javascript_dialog_manager.h

Issue 1638013002: Add UMA histograms to track very brief or frequent tabs and JS dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak comment, move JS close logic to helper func Created 4 years, 11 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
Index: components/app_modal/javascript_dialog_manager.h
diff --git a/components/app_modal/javascript_dialog_manager.h b/components/app_modal/javascript_dialog_manager.h
index b204aaf8f210c25109a16309c01c24234c456fc3..9d70bd329d701bd5eb0a410bb359108b43b8f0ec 100644
--- a/components/app_modal/javascript_dialog_manager.h
+++ b/components/app_modal/javascript_dialog_manager.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
+#include "base/time/time.h"
#include "components/app_modal/javascript_app_modal_dialog.h"
#include "content/public/browser/javascript_dialog_manager.h"
@@ -80,6 +81,11 @@ class JavaScriptDialogManager : public content::JavaScriptDialogManager {
scoped_ptr<JavaScriptNativeDialogFactory> native_dialog_factory_;
scoped_ptr<JavaScriptDialogExtensionsClient> extensions_client_;
+ // Record a single create and close timestamp to track the time between
+ // dialogs. (Since Javascript dialogs are modal, this is even accurate!)
+ base::TimeTicks last_close_time_;
+ base::TimeTicks last_creation_time_;
+
DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogManager);
};

Powered by Google App Engine
This is Rietveld 408576698