Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / predictors / predictors_handler.h
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_PREDICTORS_PREDICTORS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_HANDLER_H_
7
8 #include "base/compiler_specific.h"
9 #include "content/public/browser/web_ui_message_handler.h"
10
11 namespace base {
12 class ListValue;
13 }
14
15 namespace predictors {
16 class AutocompleteActionPredictor;
17 }
18
19 class Profile;
20
21 // The handler for Javascript messages for about:predictors.
22 class PredictorsHandler : public content::WebUIMessageHandler {
23  public:
24   explicit PredictorsHandler(Profile* profile);
25   virtual ~PredictorsHandler();
26
27   // WebUIMessageHandler implementation.
28   virtual void RegisterMessages() OVERRIDE;
29
30  private:
31   // Synchronously fetches the database from AutocompleteActionPredictor and
32   // calls into JS with the resulting DictionaryValue.
33   void RequestAutocompleteActionPredictorDb(const base::ListValue* args);
34
35   predictors::AutocompleteActionPredictor* autocomplete_action_predictor_;
36
37   DISALLOW_COPY_AND_ASSIGN(PredictorsHandler);
38 };
39
40 #endif  // CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_HANDLER_H_