| 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 CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
| 11 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 11 | 12 |
| 12 class Profile; | 13 class Profile; |
| 13 | 14 |
| 14 namespace ownership { | 15 namespace ownership { |
| 15 class OwnerKeyUtil; | 16 class OwnerKeyUtil; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| 20 class FakeOwnerSettingsService : public OwnerSettingsServiceChromeOS { | 21 class FakeOwnerSettingsService : public OwnerSettingsServiceChromeOS { |
| 21 public: | 22 public: |
| 23 explicit FakeOwnerSettingsService(Profile* profile); |
| 22 FakeOwnerSettingsService( | 24 FakeOwnerSettingsService( |
| 23 Profile* profile, | 25 Profile* profile, |
| 24 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); | 26 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); |
| 25 ~FakeOwnerSettingsService() override; | 27 ~FakeOwnerSettingsService() override; |
| 26 | 28 |
| 27 void set_set_management_settings_result(bool success) { | 29 void set_set_management_settings_result(bool success) { |
| 28 set_management_settings_result_ = success; | 30 set_management_settings_result_ = success; |
| 29 } | 31 } |
| 30 | 32 |
| 31 const ManagementSettings& last_settings() const { | 33 const ManagementSettings& last_settings() const { |
| 32 return last_settings_; | 34 return last_settings_; |
| 33 } | 35 } |
| 34 | 36 |
| 35 // OwnerSettingsServiceChromeOS: | 37 // OwnerSettingsServiceChromeOS: |
| 36 void SetManagementSettings( | 38 void SetManagementSettings( |
| 37 const ManagementSettings& settings, | 39 const ManagementSettings& settings, |
| 38 const OnManagementSettingsSetCallback& callback) override; | 40 const OnManagementSettingsSetCallback& callback) override; |
| 41 bool Set(const std::string& setting, const base::Value& value) override; |
| 39 | 42 |
| 40 private: | 43 private: |
| 41 bool set_management_settings_result_; | 44 bool set_management_settings_result_; |
| 42 ManagementSettings last_settings_; | 45 ManagementSettings last_settings_; |
| 43 | 46 |
| 44 DISALLOW_COPY_AND_ASSIGN(FakeOwnerSettingsService); | 47 DISALLOW_COPY_AND_ASSIGN(FakeOwnerSettingsService); |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 } // namespace chromeos | 50 } // namespace chromeos |
| 48 | 51 |
| 49 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ | 52 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ |
| OLD | NEW |