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

Side by Side Diff: components/policy/core/common/cloud/cloud_policy_client.h

Issue 2371213002: Refactor: Inject StatisticsProvider as a dependency of DeviceCloudPolicyInitializer. (Closed)
Patch Set: Created 4 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ 6 #define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // |callback| will be called when the operation completes. 193 // |callback| will be called when the operation completes.
194 virtual void UpdateGcmId(const std::string& gcm_id, 194 virtual void UpdateGcmId(const std::string& gcm_id,
195 const StatusCallback& callback); 195 const StatusCallback& callback);
196 196
197 // Adds an observer to be called back upon policy and state changes. 197 // Adds an observer to be called back upon policy and state changes.
198 void AddObserver(Observer* observer); 198 void AddObserver(Observer* observer);
199 199
200 // Removes the specified observer. 200 // Removes the specified observer.
201 void RemoveObserver(Observer* observer); 201 void RemoveObserver(Observer* observer);
202 202
203 const std::string& machine_id() const { return machine_id_; }
204 const std::string& machine_model() const { return machine_model_; }
205
203 void set_submit_machine_id(bool submit_machine_id) { 206 void set_submit_machine_id(bool submit_machine_id) {
204 submit_machine_id_ = submit_machine_id; 207 submit_machine_id_ = submit_machine_id;
205 } 208 }
206 209
207 void set_last_policy_timestamp(const base::Time& timestamp) { 210 void set_last_policy_timestamp(const base::Time& timestamp) {
208 last_policy_timestamp_ = timestamp; 211 last_policy_timestamp_ = timestamp;
209 } 212 }
210 213
211 void set_public_key_version(int public_key_version) { 214 void set_public_key_version(int public_key_version) {
212 public_key_version_ = public_key_version; 215 public_key_version_ = public_key_version;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // Data necessary for constructing policy requests. 374 // Data necessary for constructing policy requests.
372 const std::string machine_id_; 375 const std::string machine_id_;
373 const std::string machine_model_; 376 const std::string machine_model_;
374 const std::string verification_key_hash_; 377 const std::string verification_key_hash_;
375 PolicyTypeSet types_to_fetch_; 378 PolicyTypeSet types_to_fetch_;
376 std::vector<std::string> state_keys_to_upload_; 379 std::vector<std::string> state_keys_to_upload_;
377 380
378 std::string dm_token_; 381 std::string dm_token_;
379 DeviceMode device_mode_ = DEVICE_MODE_NOT_SET; 382 DeviceMode device_mode_ = DEVICE_MODE_NOT_SET;
380 std::string client_id_; 383 std::string client_id_;
381 bool submit_machine_id_ = false;
382 base::Time last_policy_timestamp_; 384 base::Time last_policy_timestamp_;
383 int public_key_version_ = -1; 385 int public_key_version_ = -1;
384 bool public_key_version_valid_ = false; 386 bool public_key_version_valid_ = false;
385 std::string robot_api_auth_code_; 387 std::string robot_api_auth_code_;
386 388
389 // Whether to send |machine_id_| as part of policy fetch.
Thiemo Nagel 2016/09/27 16:09:06 On the occasion, add a comment to clarify the role
390 bool submit_machine_id_ = false;
391
387 // Information for the latest policy invalidation received. 392 // Information for the latest policy invalidation received.
388 int64_t invalidation_version_ = 0; 393 int64_t invalidation_version_ = 0;
389 std::string invalidation_payload_; 394 std::string invalidation_payload_;
390 395
391 // The invalidation version used for the most recent fetch operation. 396 // The invalidation version used for the most recent fetch operation.
392 int64_t fetched_invalidation_version_ = 0; 397 int64_t fetched_invalidation_version_ = 0;
393 398
394 // Used for issuing requests to the cloud. 399 // Used for issuing requests to the cloud.
395 DeviceManagementService* service_ = nullptr; 400 DeviceManagementService* service_ = nullptr;
396 401
(...skipping 20 matching lines...) Expand all
417 422
418 // Used to create tasks which run delayed on the UI thread. 423 // Used to create tasks which run delayed on the UI thread.
419 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_; 424 base::WeakPtrFactory<CloudPolicyClient> weak_ptr_factory_;
420 425
421 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient); 426 DISALLOW_COPY_AND_ASSIGN(CloudPolicyClient);
422 }; 427 };
423 428
424 } // namespace policy 429 } // namespace policy
425 430
426 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_ 431 #endif // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698