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 #include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h" | 5 #include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/settings/cros_settings.h" | |
8 #include "components/ownership/mock_owner_key_util.h" | |
9 | |
7 namespace chromeos { | 10 namespace chromeos { |
8 | 11 |
12 FakeOwnerSettingsService::FakeOwnerSettingsService(Profile* profile) | |
13 : OwnerSettingsServiceChromeOS(nullptr, | |
14 profile, | |
15 new ownership::MockOwnerKeyUtil()), | |
16 set_management_settings_result_(true) { | |
17 } | |
18 | |
9 FakeOwnerSettingsService::FakeOwnerSettingsService( | 19 FakeOwnerSettingsService::FakeOwnerSettingsService( |
10 Profile* profile, | 20 Profile* profile, |
11 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util) | 21 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util) |
12 : OwnerSettingsServiceChromeOS(nullptr, profile, owner_key_util), | 22 : OwnerSettingsServiceChromeOS(nullptr, profile, owner_key_util), |
13 set_management_settings_result_(true) { | 23 set_management_settings_result_(true) { |
14 } | 24 } |
15 | 25 |
16 FakeOwnerSettingsService::~FakeOwnerSettingsService() { | 26 FakeOwnerSettingsService::~FakeOwnerSettingsService() { |
17 } | 27 } |
18 | 28 |
19 void FakeOwnerSettingsService::SetManagementSettings( | 29 void FakeOwnerSettingsService::SetManagementSettings( |
20 const ManagementSettings& settings, | 30 const ManagementSettings& settings, |
21 const OnManagementSettingsSetCallback& callback) { | 31 const OnManagementSettingsSetCallback& callback) { |
22 last_settings_ = settings; | 32 last_settings_ = settings; |
23 callback.Run(set_management_settings_result_); | 33 callback.Run(set_management_settings_result_); |
24 } | 34 } |
25 | 35 |
36 bool FakeOwnerSettingsService::Set(const std::string& setting, | |
37 const base::Value& value) { | |
38 CrosSettingsProvider* provider = CrosSettings::Get()->GetProvider(setting); | |
39 provider->Set(setting, value); | |
Mattias Nissler (ping if slow)
2015/03/30 14:45:46
This is not going to mix well with our goal to rem
Ivan Podogov
2015/03/31 08:40:00
As doesn't the direct use of CrosSettingsProvider:
Mattias Nissler (ping if slow)
2015/03/31 08:44:48
Ah, so we had our wires crossed here - I think all
Ivan Podogov
2015/03/31 08:51:12
Hm, this should be very well possible, although it
Mattias Nissler (ping if slow)
2015/03/31 08:56:03
Why would FakeOwnerSettingsService need to write s
Ivan Podogov
2015/03/31 09:01:21
For example, because KioskAppsManager (or KioskApp
Mattias Nissler (ping if slow)
2015/03/31 09:16:09
OwnerSettingsServiceChromeOS writes via DeviceSett
Ivan Podogov
2015/03/31 09:30:08
Well, that's what I was asking in the first place:
Mattias Nissler (ping if slow)
2015/03/31 09:36:01
Ah, sorry for the confusion then. What you suggest
| |
40 return true; | |
41 } | |
42 | |
26 } // namespace chromeos | 43 } // namespace chromeos |
OLD | NEW |