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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 2779683004: Send UMA about requested window state from tabs API (Closed)
Patch Set: Devlin's comment Created 3 years, 9 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/tabs/tabs_api.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index d20aa05375795737ea042cc6fdd18131eb6ba6db..b07aacc5589b7bd3fde1dba811f78e4b327d3d39 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -17,6 +17,7 @@
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted_memory.h"
+#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/pattern.h"
@@ -199,6 +200,11 @@ void AssignOptionalValue(const std::unique_ptr<T>& source,
}
}
+void ReportRequestedWindowState(windows::WindowState state) {
+ UMA_HISTOGRAM_ENUMERATION("TabsApi.RequestedWindowState", state,
Mark P 2017/03/28 18:23:46 It appears this enum comes from out/Debug/gen/chro
afakhry 2017/03/28 20:43:16 Hmm, but that's the whole point of this CL though.
Mark P 2017/03/28 21:02:44 You could put in a warning label that says if some
afakhry 2017/03/29 00:51:29 Done. Please take a look. Thanks!
+ windows::WINDOW_STATE_LAST + 1);
+}
+
ui::WindowShowState ConvertToWindowShowState(windows::WindowState state) {
switch (state) {
case windows::WINDOW_STATE_NORMAL:
@@ -489,6 +495,10 @@ ExtensionFunction::ResponseAction WindowsCreateFunction::Run() {
std::string extension_id;
if (create_data) {
+ // Report UMA stats to decide when to remove the deprecated "docked" windows
+ // state (crbug.com/703733).
+ ReportRequestedWindowState(create_data->state);
+
// Figure out window type before figuring out bounds so that default
// bounds can be set according to the window type.
switch (create_data->type) {
@@ -669,6 +679,10 @@ ExtensionFunction::ResponseAction WindowsUpdateFunction::Run() {
return RespondNow(Error(error));
}
+ // Report UMA stats to decide when to remove the deprecated "docked" windows
+ // state (crbug.com/703733).
+ ReportRequestedWindowState(params->update_info.state);
+
ui::WindowShowState show_state =
ConvertToWindowShowState(params->update_info.state);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698