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

Unified Diff: components/ownership/owner_settings_service.h

Issue 640063008: Revert of Implemented OwnerSettingsService::Set() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | components/ownership/owner_settings_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ownership/owner_settings_service.h
diff --git a/components/ownership/owner_settings_service.h b/components/ownership/owner_settings_service.h
index db36595d7d3601590633b8bd29f9f8c341a23192..19619757164d0afabd21f0e66f992d01f8e0720c 100644
--- a/components/ownership/owner_settings_service.h
+++ b/components/ownership/owner_settings_service.h
@@ -13,7 +13,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/ownership/ownership_export.h"
@@ -21,7 +20,6 @@
namespace base {
class TaskRunner;
-class Value;
}
namespace ownership {
@@ -33,41 +31,18 @@
// which deal with ownership, keypairs and owner-related settings.
class OWNERSHIP_EXPORT OwnerSettingsService : public KeyedService {
public:
- class Observer {
- public:
- virtual ~Observer() {}
-
- // Called when signed policy was stored, or when an error happed during
- // policy storage..
- virtual void OnSignedPolicyStored(bool success) {}
-
- // Called when tentative changes were made to policy, but the policy still
- // not signed and stored.
- //
- // TODO (ygorshenin@, crbug.com/230018): get rid of the method
- // since it creates DeviceSettingsService's dependency on
- // OwnerSettingsService.
- virtual void OnTentativeChangesInPolicy(
- const enterprise_management::PolicyData& policy_data) {}
- };
-
- typedef base::Callback<void(
- scoped_ptr<enterprise_management::PolicyFetchResponse> policy_response)>
+ typedef base::Callback<void(std::string policy_blob)>
AssembleAndSignPolicyAsyncCallback;
typedef base::Callback<void(bool is_owner)> IsOwnerCallback;
explicit OwnerSettingsService(
const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util);
- virtual ~OwnerSettingsService();
+ ~OwnerSettingsService() override;
base::WeakPtr<OwnerSettingsService> as_weak_ptr() {
return weak_factory_.GetWeakPtr();
}
-
- void AddObserver(Observer* observer);
-
- void RemoveObserver(Observer* observer);
// Returns whether current user is owner or not. When this method
// is called too early, incorrect result can be returned because
@@ -85,24 +60,12 @@
scoped_ptr<enterprise_management::PolicyData> policy,
const AssembleAndSignPolicyAsyncCallback& callback);
- // Checks whether |setting| is handled by OwnerSettingsService.
- virtual bool HandlesSetting(const std::string& setting) = 0;
-
- // Sets |setting| value to |value|.
- virtual bool Set(const std::string& setting, const base::Value& value) = 0;
-
- // Sets a bunch of device settings accumulated before ownership gets
- // established.
- //
- // TODO (ygorshenin@, crbug.com/230018): that this is a temporary
- // solution and should be removed.
- virtual bool CommitTentativeDeviceSettings(
- scoped_ptr<enterprise_management::PolicyData> policy) = 0;
-
- bool SetBoolean(const std::string& setting, bool value);
- bool SetInteger(const std::string& setting, int value);
- bool SetDouble(const std::string& setting, double value);
- bool SetString(const std::string& setting, const std::string& value);
+ // Signs |settings| with the private half of the owner key and sends
+ // the resulting policy blob for storage. The
+ // result of the operation is reported through |callback|.
+ virtual void SignAndStorePolicyAsync(
+ scoped_ptr<enterprise_management::PolicyData> policy,
+ const base::Closure& callback) = 0;
protected:
void ReloadKeypair();
@@ -126,8 +89,6 @@
std::vector<IsOwnerCallback> pending_is_owner_callbacks_;
- ObserverList<Observer> observers_;
-
base::ThreadChecker thread_checker_;
private:
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | components/ownership/owner_settings_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698