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.
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_
10 #include "base/values.h"
11 #include "chrome/browser/profiles/profile.h"
12 #include "content/public/browser/web_ui_controller.h"
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
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.
23 class SalsaUI
: public content::WebUIController
{
25 // Constructs a new GestureConfig for the specified |web_ui|.
26 explicit SalsaUI(content::WebUI
* web_ui
);
30 // Set a preference setting's value.
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.
33 void SetPreferenceValue(const base::ListValue
* args
);
35 // Record the current value for a preference key and store the key/value pair
36 // in the member variable orig_values_.
37 void BackupPreferenceValue(const base::ListValue
* args
);
39 // Check and see if a key is on the whitelist. Returns the index into
40 // the whitelist on success and -1 on failure.
41 int WhitelistIndex(const char* key
) const;
43 std::map
<int, const base::Value
*> orig_values_
;
45 DISALLOW_COPY_AND_ASSIGN(SalsaUI
);
48 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_SALSA_UI_H_