OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_KIOSK_APP_LOCAL_SETTINGS_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_KIOSK_APP_LOCAL_SETTINGS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/values.h" | |
11 #include "chrome/browser/chromeos/settings/cros_settings_provider.h" | |
12 | |
13 namespace chromeos { | |
14 | |
15 class KioskAppLocalSettings : public CrosSettingsProvider { | |
16 public: | |
17 explicit KioskAppLocalSettings(const NotifyObserversCallback& notify_cb); | |
18 virtual ~KioskAppLocalSettings(); | |
19 | |
20 private: | |
21 // Reads "apps" dict from local state and populates |apps_|. | |
22 void ReadApps(); | |
23 | |
24 // Updates "apps" dict in local state based on |value|. | |
25 void WriteApps(const base::Value& value); | |
26 | |
27 // Whether the given value contains an eligible app id for auto launch. | |
28 // The app id in the value must either be an empty string or exists in | |
29 // |apps_|. | |
30 bool IsEligibleAutoLaunchAppId(const base::Value& value) const; | |
31 | |
32 // CrosSettingsProvider overrides: | |
33 virtual const base::Value* Get(const std::string& path) const OVERRIDE; | |
34 virtual TrustedStatus PrepareTrustedValues( | |
35 const base::Closure& callback) OVERRIDE; | |
36 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; | |
37 virtual void DoSet(const std::string& path, | |
38 const base::Value& in_value) OVERRIDE; | |
39 | |
40 // This needed because "apps" in local state could not be used direct as it | |
41 // is a dictionary used for storing app info cache as well. | |
42 base::ListValue apps_; | |
43 | |
44 base::StringValue default_auto_launch_; | |
45 base::FundamentalValue default_disable_bailout_shortcut_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(KioskAppLocalSettings); | |
48 }; | |
49 | |
50 } // namespace chromeos | |
51 | |
52 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_KIOSK_APP_LOCAL_SETTINGS_H_ | |
OLD | NEW |