summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/gesture_config_ui.h
blob: 48e243307252ca6c672b656c933dab36083aa716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_WEBUI_GESTURE_CONFIG_UI_H_
#define CHROME_BROWSER_UI_WEBUI_GESTURE_CONFIG_UI_H_

#include "content/public/browser/web_ui_controller.h"

namespace base {
  class ListValue;
}  // namespace base

// The WebUI for 'chrome://gesture'.
class GestureConfigUI : public content::WebUIController {
 public:
  // Constructs a new GestureConfig for the specified |web_ui|.
  explicit GestureConfigUI(content::WebUI* web_ui);
  ~GestureConfigUI() override;

 private:
  // TODO(mohsen): Add a whitelist of preferences that are allowed to be set or
  // get here and check requested preferences against this whitelist.

  /**
   * Request a preference setting's value.
   * This method is asynchronous; the result is provided by a call to
   * the JS method 'gesture_config.updatePreferenceValueResult'.
   */
  void UpdatePreferenceValue(const base::ListValue* args);

  /**
   * Reset a preference to its default value and return this value
   * via asynchronous callback to the JS method
   * 'gesture_config.updatePreferenceValueResult'.
   */
  void ResetPreferenceValue(const base::ListValue* args);

  /**
   * Set a preference setting's value.
   * Two parameters are provided in a JS list: prefName and value, the
   * key of the preference value to be set, and the value it's to be set to.
   */
  void SetPreferenceValue(const base::ListValue* args);

  DISALLOW_COPY_AND_ASSIGN(GestureConfigUI);
};

#endif  // CHROME_BROWSER_UI_WEBUI_GESTURE_CONFIG_UI_H_