Chromium Code Reviews| 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); |