Home | History | Annotate | Download | only in webui
      1 // Copyright (c) 2012 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_UI_WEBUI_GESTURE_CONFIG_UI_H_
      6 #define CHROME_BROWSER_UI_WEBUI_GESTURE_CONFIG_UI_H_
      7 
      8 #include "content/public/browser/web_ui_controller.h"
      9 
     10 namespace base {
     11   class ListValue;
     12 }  // namespace base
     13 
     14 // The WebUI for 'chrome://gesture'.
     15 class GestureConfigUI : public content::WebUIController {
     16  public:
     17   // Constructs a new GestureConfig for the specified |web_ui|.
     18   explicit GestureConfigUI(content::WebUI* web_ui);
     19   virtual ~GestureConfigUI();
     20 
     21  private:
     22   // TODO(mohsen): Add a whitelist of preferences that are allowed to be set or
     23   // get here and check requested preferences against this whitelist.
     24 
     25   /**
     26    * Request a preference setting's value.
     27    * This method is asynchronous; the result is provided by a call to
     28    * the JS method 'gesture_config.updatePreferenceValueResult'.
     29    */
     30   void UpdatePreferenceValue(const base::ListValue* args);
     31 
     32   /**
     33    * Reset a preference to its default value and return this value
     34    * via asynchronous callback to the JS method
     35    * 'gesture_config.updatePreferenceValueResult'.
     36    */
     37   void ResetPreferenceValue(const base::ListValue* args);
     38 
     39   /**
     40    * Set a preference setting's value.
     41    * Two parameters are provided in a JS list: prefName and value, the
     42    * key of the preference value to be set, and the value it's to be set to.
     43    */
     44   void SetPreferenceValue(const base::ListValue* args);
     45 
     46   DISALLOW_COPY_AND_ASSIGN(GestureConfigUI);
     47 };
     48 
     49 #endif  // CHROME_BROWSER_UI_WEBUI_GESTURE_CONFIG_UI_H_
     50