| 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_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_UI_H
ANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_UI_H
ANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_UI_H
ANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_UI_H
ANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| 11 #include "chrome/browser/ui/webui/ntp/suggestions_combiner.h" | 11 #include "chrome/browser/ui/webui/ntp/suggestions_combiner.h" |
| 12 #include "content/public/browser/web_ui_message_handler.h" | 12 #include "content/public/browser/web_ui_message_handler.h" |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace base { |
| 17 class ListValue; |
| 18 } |
| 19 |
| 16 // UI Handler for chrome://suggestions-internals/ | 20 // UI Handler for chrome://suggestions-internals/ |
| 17 class SuggestionsInternalsUIHandler : public content::WebUIMessageHandler, | 21 class SuggestionsInternalsUIHandler : public content::WebUIMessageHandler, |
| 18 public SuggestionsCombiner::Delegate { | 22 public SuggestionsCombiner::Delegate { |
| 19 public: | 23 public: |
| 20 explicit SuggestionsInternalsUIHandler(Profile* profile); | 24 explicit SuggestionsInternalsUIHandler(Profile* profile); |
| 21 virtual ~SuggestionsInternalsUIHandler(); | 25 virtual ~SuggestionsInternalsUIHandler(); |
| 22 | 26 |
| 23 // SuggestionsCombiner::Delegate implementation. | 27 // SuggestionsCombiner::Delegate implementation. |
| 24 virtual void OnSuggestionsReady() OVERRIDE; | 28 virtual void OnSuggestionsReady() OVERRIDE; |
| 25 | 29 |
| 26 protected: | 30 protected: |
| 27 // WebUIMessageHandler implementation. | 31 // WebUIMessageHandler implementation. |
| 28 // Register our handler to get callbacks from javascript. | 32 // Register our handler to get callbacks from javascript. |
| 29 virtual void RegisterMessages() OVERRIDE; | 33 virtual void RegisterMessages() OVERRIDE; |
| 30 | 34 |
| 31 void HandleGetSuggestions(const base::ListValue* one_element_input_string); | 35 void HandleGetSuggestions(const base::ListValue* one_element_input_string); |
| 32 | 36 |
| 33 // Used to combine suggestions from various sources. | 37 // Used to combine suggestions from various sources. |
| 34 scoped_ptr<SuggestionsCombiner> suggestions_combiner_; | 38 scoped_ptr<SuggestionsCombiner> suggestions_combiner_; |
| 35 | 39 |
| 36 Profile* profile_; | 40 Profile* profile_; |
| 37 | 41 |
| 38 DISALLOW_COPY_AND_ASSIGN(SuggestionsInternalsUIHandler); | 42 DISALLOW_COPY_AND_ASSIGN(SuggestionsInternalsUIHandler); |
| 39 }; | 43 }; |
| 40 | 44 |
| 41 #endif // CHROME_BROWSER_UI_WEBUI_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_U
I_HANDLER_H_ | 45 #endif // CHROME_BROWSER_UI_WEBUI_SUGGESTIONS_INTERNALS_SUGGESTIONS_INTERNALS_U
I_HANDLER_H_ |
| OLD | NEW |