Chromium Code Reviews| Index: chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc |
| diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc b/chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc |
| index 3559f376a678aa8b5671f2a8e86a92ff8d2964b1..af0423b086d3d488bc4ed3099f3bff4bada70866 100644 |
| --- a/chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc |
| +++ b/chrome/browser/ui/exclusive_access/exclusive_access_controller_base.cc |
| @@ -4,6 +4,7 @@ |
| #include "chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h" |
| +#include "base/metrics/histogram_macros.h" |
| #include "chrome/browser/chrome_notification_types.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
| @@ -14,10 +15,16 @@ |
| using content::WebContents; |
| +namespace { |
| + |
| +const char kBubbleReshowsHistogramPrefix[] = |
| + "ExclusiveAccess.BubbleReshowsPerSession."; |
| + |
| +} // namespace |
| + |
| ExclusiveAccessControllerBase::ExclusiveAccessControllerBase( |
| ExclusiveAccessManager* manager) |
| - : manager_(manager), tab_with_exclusive_access_(nullptr) { |
| -} |
| + : manager_(manager) {} |
| ExclusiveAccessControllerBase::~ExclusiveAccessControllerBase() { |
| } |
| @@ -66,6 +73,22 @@ void ExclusiveAccessControllerBase::Observe( |
| ExitExclusiveAccessIfNecessary(); |
| } |
| +void ExclusiveAccessControllerBase::BubbleReshown() { |
| + ++bubble_reshow_count_; |
| +} |
| + |
| +void ExclusiveAccessControllerBase::Exiting() { |
| + // Record the number of bubble reshows during this session. Only if simplified |
| + // fullscreen is enabled. |
| + if (ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled()) { |
| + std::string histogram_name = kBubbleReshowsHistogramPrefix; |
| + histogram_name += HistogramSuffix(); |
| + UMA_HISTOGRAM_COUNTS_100(histogram_name, bubble_reshow_count_); |
|
Ilya Sherman
2016/02/24 01:08:20
The UMA_HISTOGRAM_* macros require that histogram
Matt Giuca
2016/02/24 03:00:31
They do? I could do that but I'm not sure why it's
Matt Giuca
2016/02/24 04:01:00
Oh right... I just hit the DCHECK in HistogramBase
Ilya Sherman
2016/02/24 06:42:34
Yeah, it is definitely a rather epic comment. I a
Matt Giuca
2016/02/25 04:27:08
I'd rather use the macro than manually inlining it
|
| + } |
| + |
| + bubble_reshow_count_ = 0; |
| +} |
| + |
| void ExclusiveAccessControllerBase::SetTabWithExclusiveAccess( |
| WebContents* tab) { |
| // Tab should never be replaced with another tab, or |