OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_DOM_HAN
DLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_DOM_HAN
DLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/public/browser/web_ui_message_handler.h" | 10 #include "content/public/browser/web_ui_message_handler.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class ListValue; | 13 class ListValue; |
14 } | 14 } |
15 | 15 |
| 16 namespace predictors { |
16 class AutocompleteActionPredictor; | 17 class AutocompleteActionPredictor; |
| 18 } |
| 19 |
17 class Profile; | 20 class Profile; |
18 | 21 |
19 // The handler for Javascript messages for about:predictors. | 22 // The handler for Javascript messages for about:predictors. |
20 class AutocompleteActionPredictorDOMHandler | 23 class PredictorsHandler : public content::WebUIMessageHandler { |
21 : public content::WebUIMessageHandler { | |
22 public: | 24 public: |
23 explicit AutocompleteActionPredictorDOMHandler(Profile* profile); | 25 explicit PredictorsHandler(Profile* profile); |
24 virtual ~AutocompleteActionPredictorDOMHandler(); | 26 virtual ~PredictorsHandler(); |
25 | 27 |
26 // WebUIMessageHandler implementation. | 28 // WebUIMessageHandler implementation. |
27 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() OVERRIDE; |
28 | 30 |
29 private: | 31 private: |
30 // Synchronously fetches the database from AutocompleteActionPredictor and | 32 // Synchronously fetches the database from AutocompleteActionPredictor and |
31 // calls into JS with the resulting DictionaryValue. | 33 // calls into JS with the resulting DictionaryValue. |
32 void RequestAutocompleteActionPredictorDb(const base::ListValue* args); | 34 void RequestAutocompleteActionPredictorDb(const base::ListValue* args); |
33 | 35 |
34 AutocompleteActionPredictor* autocomplete_action_predictor_; | 36 predictors::AutocompleteActionPredictor* autocomplete_action_predictor_; |
35 | 37 |
36 DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictorDOMHandler); | 38 DISALLOW_COPY_AND_ASSIGN(PredictorsHandler); |
37 }; | 39 }; |
38 | 40 |
39 #endif // CHROME_BROWSER_UI_WEBUI_PREDICTORS_AUTOCOMPLETE_ACTION_PREDICTOR_DOM_
HANDLER_H_ | 41 #endif // CHROME_BROWSER_UI_WEBUI_PREDICTORS_PREDICTORS_HANDLER_H_ |
OLD | NEW |