| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/metrics/proto/system_profile.pb.h" | 13 #include "components/metrics/proto/system_profile.pb.h" |
| 14 | 14 |
| 15 namespace metrics { | 15 namespace metrics { |
| 16 | 16 |
| 17 class MetricsLogUploader; | 17 class MetricsLogUploader; |
| 18 | 18 |
| 19 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | 19 // An abstraction of operations that depend on the embedder's (e.g. Chrome) |
| 20 // environment. | 20 // environment. |
| 21 class MetricsServiceClient { | 21 class MetricsServiceClient { |
| 22 public: | 22 public: |
| 23 virtual ~MetricsServiceClient() {} | 23 virtual ~MetricsServiceClient() {} |
| 24 | 24 |
| 25 // Register the client id with other services (e.g. crash reporting), called | 25 // Registers the client id with other services (e.g. crash reporting), called |
| 26 // when metrics recording gets enabled. | 26 // when metrics recording gets enabled. |
| 27 virtual void SetClientID(const std::string& client_id) = 0; | 27 virtual void SetMetricsClientId(const std::string& client_id) = 0; |
| 28 | 28 |
| 29 // Whether there's an "off the record" (aka "Incognito") session active. | 29 // Whether there's an "off the record" (aka "Incognito") session active. |
| 30 virtual bool IsOffTheRecordSessionActive() = 0; | 30 virtual bool IsOffTheRecordSessionActive() = 0; |
| 31 | 31 |
| 32 // Returns the current application locale (e.g. "en-US"). | 32 // Returns the current application locale (e.g. "en-US"). |
| 33 virtual std::string GetApplicationLocale() = 0; | 33 virtual std::string GetApplicationLocale() = 0; |
| 34 | 34 |
| 35 // Retrieves the brand code string associated with the install, returning | 35 // Retrieves the brand code string associated with the install, returning |
| 36 // false if no brand code is available. | 36 // false if no brand code is available. |
| 37 virtual bool GetBrand(std::string* brand_code) = 0; | 37 virtual bool GetBrand(std::string* brand_code) = 0; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 58 // MetricsLogUploader for details). | 58 // MetricsLogUploader for details). |
| 59 virtual scoped_ptr<MetricsLogUploader> CreateUploader( | 59 virtual scoped_ptr<MetricsLogUploader> CreateUploader( |
| 60 const std::string& server_url, | 60 const std::string& server_url, |
| 61 const std::string& mime_type, | 61 const std::string& mime_type, |
| 62 const base::Callback<void(int)>& on_upload_complete) = 0; | 62 const base::Callback<void(int)>& on_upload_complete) = 0; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace metrics | 65 } // namespace metrics |
| 66 | 66 |
| 67 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 67 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |