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

Side by Side Diff: chrome/browser/policy/cloud_policy_data_store.h

Issue 9403010: Add support for kiosk mode on the client. Make sure the settings are written in the lockbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and added more tests. Created 8 years, 10 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 | Annotate | Revision Log
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 CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_
6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ 6 #define CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/observer_list.h" 12 #include "base/observer_list.h"
13 #include "chrome/browser/policy/cloud_policy_constants.h" 13 #include "chrome/browser/policy/cloud_policy_constants.h"
14 #include "chrome/browser/policy/proto/device_management_backend.pb.h" 14 #include "chrome/browser/policy/proto/device_management_backend.pb.h"
15 15
16 #if defined(OS_CHROMEOS) 16 #if defined(OS_CHROMEOS)
17 #include "chrome/browser/policy/device_status_collector.h" 17 #include "chrome/browser/policy/device_status_collector.h"
18 #include "chrome/browser/policy/enterprise_install_attributes.h"
18 #endif 19 #endif
19 20
20 namespace policy { 21 namespace policy {
21 22
22 // Stores in memory all the data that is used in the cloud policy subsystem, 23 // Stores in memory all the data that is used in the cloud policy subsystem,
23 // and manages notification about changes to these fields. 24 // and manages notification about changes to these fields.
24 // TODO(gfeher): The policy data stored in CloudPolicyCacheBase is currently 25 // TODO(gfeher): The policy data stored in CloudPolicyCacheBase is currently
25 // an exception, move that here. 26 // an exception, move that here.
26 class CloudPolicyDataStore { 27 class CloudPolicyDataStore {
27 public: 28 public:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool token_cache_loaded); 72 bool token_cache_loaded);
72 73
73 void set_device_id(const std::string& device_id); 74 void set_device_id(const std::string& device_id);
74 void set_machine_id(const std::string& machine_id); 75 void set_machine_id(const std::string& machine_id);
75 void set_machine_model(const std::string& machine_model); 76 void set_machine_model(const std::string& machine_model);
76 void set_user_name(const std::string& user_name); 77 void set_user_name(const std::string& user_name);
77 void set_user_affiliation(UserAffiliation user_affiliation); 78 void set_user_affiliation(UserAffiliation user_affiliation);
78 void set_known_machine_id(bool known_machine_id); 79 void set_known_machine_id(bool known_machine_id);
79 80
80 #if defined(OS_CHROMEOS) 81 #if defined(OS_CHROMEOS)
82 void set_device_mode(EnterpriseInstallAttributes::DeviceMode device_mode);
83 EnterpriseInstallAttributes::DeviceMode device_mode() const;
81 void set_device_status_collector(DeviceStatusCollector* collector); 84 void set_device_status_collector(DeviceStatusCollector* collector);
82 DeviceStatusCollector* device_status_collector(); 85 DeviceStatusCollector* device_status_collector();
83 #endif 86 #endif
84 87
85 const std::string& device_id() const; 88 const std::string& device_id() const;
86 const std::string& device_token() const; 89 const std::string& device_token() const;
87 const std::string& gaia_token() const; 90 const std::string& gaia_token() const;
88 const std::string& oauth_token() const; 91 const std::string& oauth_token() const;
89 bool has_auth_token() const; 92 bool has_auth_token() const;
90 const std::string& machine_id() const; 93 const std::string& machine_id() const;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 127
125 // Data used for constructiong both register and policy requests. 128 // Data used for constructiong both register and policy requests.
126 std::string device_id_; 129 std::string device_id_;
127 std::string machine_model_; 130 std::string machine_model_;
128 std::string machine_id_; 131 std::string machine_id_;
129 bool known_machine_id_; 132 bool known_machine_id_;
130 133
131 bool token_cache_loaded_; 134 bool token_cache_loaded_;
132 135
133 #if defined(OS_CHROMEOS) 136 #if defined(OS_CHROMEOS)
137 EnterpriseInstallAttributes::DeviceMode device_mode_;
134 scoped_ptr<DeviceStatusCollector> device_status_collector_; 138 scoped_ptr<DeviceStatusCollector> device_status_collector_;
135 #endif 139 #endif
136 140
137 ObserverList<Observer, true> observer_list_; 141 ObserverList<Observer, true> observer_list_;
138 142
139 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore); 143 DISALLOW_COPY_AND_ASSIGN(CloudPolicyDataStore);
140 }; 144 };
141 145
142 } // namespace policy 146 } // namespace policy
143 147
144 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_ 148 #endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_DATA_STORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698