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

Unified Diff: chrome/browser/ui/exclusive_access/mouse_lock_controller.cc

Issue 1721633002: Added UMA collection for fullscreen / mouse lock bubble re-shows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved histogram recording into each subclass. (Fix DCHECK / incorrect histogram recording.) Created 4 years, 10 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 | « chrome/browser/ui/exclusive_access/mouse_lock_controller.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
diff --git a/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc b/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
index a22df90e66500a96373f61379be54a11f78454b4..7607f7c99679617f0323ed031ecaef307d14386e 100644
--- a/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
+++ b/chrome/browser/ui/exclusive_access/mouse_lock_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/exclusive_access/mouse_lock_controller.h"
+#include "base/metrics/histogram_macros.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -21,6 +22,13 @@
using content::RenderViewHost;
using content::WebContents;
+namespace {
+
+const char kBubbleReshowsHistogramName[] =
+ "ExclusiveAccess.BubbleReshowsPerSession.MouseLock";
+
+} // namespace
+
MouseLockController::MouseLockController(ExclusiveAccessManager* manager)
: ExclusiveAccessControllerBase(manager),
mouse_lock_state_(MOUSELOCK_NOT_REQUESTED),
@@ -116,6 +124,11 @@ void MouseLockController::NotifyTabExclusiveAccessLost() {
}
}
+void MouseLockController::RecordBubbleReshowsHistogram(
+ int bubble_reshow_count) {
+ UMA_HISTOGRAM_COUNTS_100(kBubbleReshowsHistogramName, bubble_reshow_count);
+}
+
bool MouseLockController::HandleUserPressedEscape() {
if (IsMouseLocked() || IsMouseLockRequested()) {
ExitExclusiveAccessIfNecessary();
@@ -188,6 +201,7 @@ bool MouseLockController::OnDenyExclusiveAccessPermission() {
}
void MouseLockController::LostMouseLock() {
+ RecordExitingUMA();
mouse_lock_state_ = MOUSELOCK_NOT_REQUESTED;
SetTabWithExclusiveAccess(nullptr);
NotifyMouseLockChange();
« no previous file with comments | « chrome/browser/ui/exclusive_access/mouse_lock_controller.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698