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

Side by Side Diff: chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h

Issue 641453003: Add metrics for the number of attached displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android gn. Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ 5 #ifndef CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_
6 #define CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ 6 #define CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chrome/browser/chrome_browser_main_extra_parts.h" 11 #include "chrome/browser/chrome_browser_main_extra_parts.h"
12 #include "ui/gfx/display_observer.h"
12 13
13 class ChromeBrowserMainParts; 14 class ChromeBrowserMainParts;
14 15
15 namespace chrome { 16 namespace chrome {
16 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts); 17 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts);
17 } 18 }
18 19
19 class ChromeBrowserMainExtraPartsMetrics : public ChromeBrowserMainExtraParts { 20 class ChromeBrowserMainExtraPartsMetrics : public ChromeBrowserMainExtraParts,
21 public gfx::DisplayObserver {
20 public: 22 public:
21 ChromeBrowserMainExtraPartsMetrics(); 23 ChromeBrowserMainExtraPartsMetrics();
22 ~ChromeBrowserMainExtraPartsMetrics() override; 24 ~ChromeBrowserMainExtraPartsMetrics() override;
23 25
24 // Overridden from ChromeBrowserMainExtraParts: 26 // Overridden from ChromeBrowserMainExtraParts:
25 void PreProfileInit() override; 27 void PreProfileInit() override;
26 void PreBrowserStart() override; 28 void PreBrowserStart() override;
27 void PostBrowserStart() override; 29 void PostBrowserStart() override;
28 30
29 private: 31 private:
30 #if defined(OS_MACOSX) && !defined(OS_IOS) 32 #if defined(OS_MACOSX) && !defined(OS_IOS)
31 // Records Mac specific metrics. 33 // Records Mac specific metrics.
32 void RecordMacMetrics(); 34 void RecordMacMetrics();
33 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 35 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
34 36
37 // DisplayObserver overrides.
38 virtual void OnDisplayAdded(const gfx::Display& new_display) override;
39 virtual void OnDisplayRemoved(const gfx::Display& old_display) override;
40 virtual void OnDisplayMetricsChanged(const gfx::Display& display,
41 uint32_t changed_metrics) override;
42
43 // If the number of displays has changed, emit a UMA metric.
44 void EmitDisplaysChangedMetric();
45
46 // A cached value for the number of displays.
47 int display_count_;
Ilya Sherman 2014/10/29 01:30:10 nit: Please leave a blank line after this one.
erikchen 2014/10/29 17:15:41 Done.
48 // This parameter is set to true after an instance of this class makes itself
Ilya Sherman 2014/10/29 01:30:10 nit: "parameter" -> "variable" (though, I'd actual
erikchen 2014/10/29 17:15:41 Went with your suggestion.
49 // an observer of the native screen.
50 bool is_screen_observer_;
51
35 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsMetrics); 52 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsMetrics);
36 }; 53 };
37 54
38 #endif // CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_ 55 #endif // CHROME_BROWSER_METRICS_CHROME_BROWSER_MAIN_EXTRA_PARTS_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698