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

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

Issue 2779683004: Send UMA about requested window state from tabs API (Closed)
Patch Set: mpearson's 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 | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »
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 177698b372d8d6313c00750c28287e18915feb12..fb448f7971c488fbccf548c734d63c4e4d2e6cfe 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,
+ 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 | chrome/common/extensions/api/windows.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698