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

Side by Side Diff: chromecast/metrics/cast_metrics_service_client.h

Issue 638803002: Reorganizes Chromecast code to better reflect functional dependencies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: extra DEPS: chromecast/crash/android --> chromecast/common Created 6 years, 2 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 2014 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 CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_
6 #define CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "components/metrics/metrics_service_client.h"
14
15 class PrefService;
16
17 namespace base {
18 class MessageLoopProxy;
19 class TaskRunner;
20 }
21
22 namespace metrics {
23 class MetricsService;
24 class MetricsStateManager;
25 } // namespace metrics
26
27 namespace net {
28 class URLRequestContextGetter;
29 } // namespace net
30
31 namespace chromecast {
32 namespace metrics {
33
34 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient {
35 public:
36 virtual ~CastMetricsServiceClient();
37
38 static CastMetricsServiceClient* Create(
39 base::TaskRunner* io_task_runner,
40 PrefService* pref_service,
41 net::URLRequestContextGetter* request_context);
42
43 // metrics::MetricsServiceClient implementation:
44 virtual void SetMetricsClientId(const std::string& client_id) override;
45 virtual bool IsOffTheRecordSessionActive() override;
46 virtual int32_t GetProduct() override;
47 virtual std::string GetApplicationLocale() override;
48 virtual bool GetBrand(std::string* brand_code) override;
49 virtual ::metrics::SystemProfileProto::Channel GetChannel() override;
50 virtual std::string GetVersionString() override;
51 virtual void OnLogUploadComplete() override;
52 virtual void StartGatheringMetrics(
53 const base::Closure& done_callback) override;
54 virtual void CollectFinalMetrics(const base::Closure& done_callback) override;
55 virtual scoped_ptr< ::metrics::MetricsLogUploader> CreateUploader(
56 const std::string& server_url,
57 const std::string& mime_type,
58 const base::Callback<void(int)>& on_upload_complete) override;
59
60 // Starts/stops the metrics service.
61 void EnableMetricsService(bool enabled);
62
63 private:
64 CastMetricsServiceClient(
65 base::TaskRunner* io_task_runner,
66 PrefService* pref_service,
67 net::URLRequestContextGetter* request_context);
68
69 // Returns whether or not metrics reporting is enabled.
70 bool IsReportingEnabled();
71
72 scoped_ptr< ::metrics::MetricsStateManager> metrics_state_manager_;
73 scoped_ptr< ::metrics::MetricsService> metrics_service_;
74 scoped_refptr<base::MessageLoopProxy> metrics_service_loop_;
75 net::URLRequestContextGetter* request_context_;
76
77 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient);
78 };
79
80 } // namespace metrics
81 } // namespace chromecast
82
83 #endif // CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_
OLDNEW
« no previous file with comments | « chromecast/metrics/cast_metrics_prefs.cc ('k') | chromecast/metrics/cast_metrics_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698