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

Side by Side Diff: chrome/browser/chromeos/ownership/fake_owner_settings_service.h

Issue 1019283004: Switch to direct use of OwnerSettingsServiceChromeOS::Set() in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use settings provider to set read-only device settings. Created 5 years, 8 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 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"
Mattias Nissler (ping if slow) 2015/03/30 14:45:46 not needed?
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698