OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
7 | 7 |
| 8 #include <stdint.h> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
14 #include "components/metrics/proto/system_profile.pb.h" | 15 #include "components/metrics/proto/system_profile.pb.h" |
15 | 16 |
16 namespace metrics { | 17 namespace metrics { |
17 | 18 |
18 class MetricsLogUploader; | 19 class MetricsLogUploader; |
19 | 20 |
20 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | 21 // An abstraction of operations that depend on the embedder's (e.g. Chrome) |
21 // environment. | 22 // environment. |
22 class MetricsServiceClient { | 23 class MetricsServiceClient { |
23 public: | 24 public: |
24 virtual ~MetricsServiceClient() {} | 25 virtual ~MetricsServiceClient() {} |
25 | 26 |
26 // Registers the client id with other services (e.g. crash reporting), called | 27 // Registers the client id with other services (e.g. crash reporting), called |
27 // when metrics recording gets enabled. | 28 // when metrics recording gets enabled. |
28 virtual void SetMetricsClientId(const std::string& client_id) = 0; | 29 virtual void SetMetricsClientId(const std::string& client_id) = 0; |
29 | 30 |
30 // Whether there's an "off the record" (aka "Incognito") session active. | 31 // Whether there's an "off the record" (aka "Incognito") session active. |
31 virtual bool IsOffTheRecordSessionActive() = 0; | 32 virtual bool IsOffTheRecordSessionActive() = 0; |
32 | 33 |
| 34 // Returns the product value to use in uploaded reports, which will be used to |
| 35 // set the ChromeUserMetricsExtension.product field. See comments on that |
| 36 // field on why it's an int32 rather than an enum. |
| 37 virtual int32_t GetProduct() = 0; |
| 38 |
33 // Returns the current application locale (e.g. "en-US"). | 39 // Returns the current application locale (e.g. "en-US"). |
34 virtual std::string GetApplicationLocale() = 0; | 40 virtual std::string GetApplicationLocale() = 0; |
35 | 41 |
36 // Retrieves the brand code string associated with the install, returning | 42 // Retrieves the brand code string associated with the install, returning |
37 // false if no brand code is available. | 43 // false if no brand code is available. |
38 virtual bool GetBrand(std::string* brand_code) = 0; | 44 virtual bool GetBrand(std::string* brand_code) = 0; |
39 | 45 |
40 // Returns the release channel (e.g. stable, beta, etc) of the application. | 46 // Returns the release channel (e.g. stable, beta, etc) of the application. |
41 virtual SystemProfileProto::Channel GetChannel() = 0; | 47 virtual SystemProfileProto::Channel GetChannel() = 0; |
42 | 48 |
(...skipping 20 matching lines...) Expand all Loading... |
63 const base::Callback<void(int)>& on_upload_complete) = 0; | 69 const base::Callback<void(int)>& on_upload_complete) = 0; |
64 | 70 |
65 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store | 71 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store |
66 // backups of metrics data. Unused except on Windows. | 72 // backups of metrics data. Unused except on Windows. |
67 virtual base::string16 GetRegistryBackupKey(); | 73 virtual base::string16 GetRegistryBackupKey(); |
68 }; | 74 }; |
69 | 75 |
70 } // namespace metrics | 76 } // namespace metrics |
71 | 77 |
72 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 78 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |