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

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

Issue 1218583002: metrics: Add dbus interface for GetRandomPerfOutput (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check has_ms_after_login() instead of ms_after_login() value Created 5 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_METRICS_WINDOWED_INCOGNITO_OBSERVER_H_
6 #define CHROME_BROWSER_METRICS_WINDOWED_INCOGNITO_OBSERVER_H_
7
8 #include "base/macros.h"
9 #include "chrome/browser/ui/browser_list_observer.h"
10
11 class Browser;
12
13 namespace metrics {
14
15 // This class watches for any incognito window being opened from the time it is
16 // instantiated to the time it is destroyed.
17 class WindowedIncognitoObserver : public chrome::BrowserListObserver {
18 public:
19 WindowedIncognitoObserver();
20 ~WindowedIncognitoObserver() override;
21
22 // This method can be checked to see whether any incognito window has been
23 // opened since the time this object was created.
24 bool incognito_launched() const {
25 return incognito_launched_;
26 }
27
28 protected:
29 // For testing.
30 void set_incognito_launched(bool value) {
31 incognito_launched_ = value;
32 }
33
34 private:
35 // chrome::BrowserListObserver implementation.
36 void OnBrowserAdded(Browser* browser) override;
37
38 // Gets set if an incognito window was opened during the lifetime of the
39 // object. Closing the window does not clear the flag.
40 bool incognito_launched_;
41
42 DISALLOW_COPY_AND_ASSIGN(WindowedIncognitoObserver);
43 };
44
45 } // namespace metrics
46
47 #endif // CHROME_BROWSER_METRICS_WINDOWED_INCOGNITO_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/perf_provider_chromeos_unittest.cc ('k') | chrome/browser/metrics/windowed_incognito_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698