OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_UI_WEBUI_CHROMEOS_SALSA_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "content/public/browser/web_ui_controller.h" | 12 #include "content/public/browser/web_ui_controller.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class ListValue; | 15 class ListValue; |
16 class Value; | 16 class Value; |
17 } // namespace base | 17 } // namespace base |
18 | 18 |
19 // The WebUI for 'chrome://salsa' -- a user front end for the touch UI | 19 // The WebUI for 'chrome://salsa' -- a user front end for the touch UI |
20 // blind user studies. I does this by setting gesture preference values | 20 // blind user studies. I does this by setting gesture preference values |
21 // without the user knowing which ones and having them try out various | 21 // without the user knowing which ones and having them try out various |
22 // settings to see which results in a better experience for them. | 22 // settings to see which results in a better experience for them. |
23 class SalsaUI : public content::WebUIController { | 23 class SalsaUI : public content::WebUIController { |
24 public: | 24 public: |
25 // Constructs a new GestureConfig for the specified |web_ui|. | 25 // Constructs a new GestureConfig for the specified |web_ui|. |
26 explicit SalsaUI(content::WebUI* web_ui); | 26 explicit SalsaUI(content::WebUI* web_ui); |
27 virtual ~SalsaUI(); | 27 ~SalsaUI() override; |
28 | 28 |
29 private: | 29 private: |
30 // Set a preference setting's value. | 30 // Set a preference setting's value. |
31 // Two parameters are provided in a JS list: prefName and value, the | 31 // Two parameters are provided in a JS list: prefName and value, the |
32 // key of the preference value to be set, and the value it's to be set to. | 32 // key of the preference value to be set, and the value it's to be set to. |
33 void SetPreferenceValue(const base::ListValue* args); | 33 void SetPreferenceValue(const base::ListValue* args); |
34 | 34 |
35 // Record the current value for a preference key and store the key/value pair | 35 // Record the current value for a preference key and store the key/value pair |
36 // in the member variable orig_values_. | 36 // in the member variable orig_values_. |
37 void BackupPreferenceValue(const base::ListValue* args); | 37 void BackupPreferenceValue(const base::ListValue* args); |
38 | 38 |
39 // Check and see if a key is on the whitelist. Returns the index into | 39 // Check and see if a key is on the whitelist. Returns the index into |
40 // the whitelist on success and -1 on failure. | 40 // the whitelist on success and -1 on failure. |
41 int WhitelistIndex(const char* key) const; | 41 int WhitelistIndex(const char* key) const; |
42 | 42 |
43 std::map<int, const base::Value*> orig_values_; | 43 std::map<int, const base::Value*> orig_values_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(SalsaUI); | 45 DISALLOW_COPY_AND_ASSIGN(SalsaUI); |
46 }; | 46 }; |
47 | 47 |
48 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_ | 48 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_ |
49 | 49 |
OLD | NEW |