1 // Copyright 2013 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.
5 #ifndef COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_HANDLER_H_
6 #define COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_HANDLER_H_
10 #include "base/memory/weak_ptr.h"
11 #include "base/values.h"
12 #include "content/public/browser/web_ui_message_handler.h"
14 namespace dom_distiller {
16 // Handler class for DOM Distiller page operations.
17 class DomDistillerHandler : public content::WebUIMessageHandler {
19 DomDistillerHandler();
20 virtual ~DomDistillerHandler();
22 // content::WebUIMessageHandler implementation.
23 virtual void RegisterMessages() OVERRIDE;
25 // Callback for the "requestEntries" message. This synchronously requests the
26 // list of entries and returns it to the front end.
27 virtual void HandleRequestEntries(const ListValue* args);
30 // Factory for the creating refs in callbacks.
31 base::WeakPtrFactory<DomDistillerHandler> weak_ptr_factory_;
33 DISALLOW_COPY_AND_ASSIGN(DomDistillerHandler);
36 } // namespace dom_distiller
38 #endif // COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_HANDLER_H_