Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: components/dom_distiller/webui/dom_distiller_handler.h

Issue 105623002: Debug UI for DOM distiller supports distillation and lists articles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix strings and dependencies for ios Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/webui/dom_distiller_handler.h
diff --git a/components/dom_distiller/webui/dom_distiller_handler.h b/components/dom_distiller/webui/dom_distiller_handler.h
index 2af6d348b0095beae82956a71b8d3f6c1b3f07c5..faf251cbd7ae6d19030881c94b7b5f30c912dd41 100644
--- a/components/dom_distiller/webui/dom_distiller_handler.h
+++ b/components/dom_distiller/webui/dom_distiller_handler.h
@@ -5,31 +5,49 @@
#ifndef COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_HANDLER_H_
#define COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_HANDLER_H_
-#include <vector>
-
#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "content/public/browser/web_ui_message_handler.h"
namespace dom_distiller {
-// Handler class for DOM Distiller page operations.
+class DomDistillerService;
+
+// Handler class for DOM Distiller list operations.
class DomDistillerHandler : public content::WebUIMessageHandler {
public:
- DomDistillerHandler();
+ // The lifetime of |service| has to outlive this handler.
+ DomDistillerHandler(DomDistillerService* service,
+ const std::string& scheme);
virtual ~DomDistillerHandler();
// content::WebUIMessageHandler implementation.
virtual void RegisterMessages() OVERRIDE;
- // Callback for the "requestEntries" message. This synchronously requests the
- // list of entries and returns it to the front end.
- virtual void HandleRequestEntries(const ListValue* args);
+ // Callback from JavaScript for the "requestEntries" message. This
+ // requests the list of entries and returns it to the front end by calling
+ // "onReceivedEntries". There are no JavaScript arguments to this method.
+ void HandleRequestEntries(const ListValue* args);
+
+ // Callback from JavaScript for when an article should be added. The first
+ // element in |args| should be a string representing the URL to be added.
+ void HandleAddArticle(const ListValue* args);
+
+ // Callback from JavaScript for when an article is selected. The first element
+ // in |args| should be a string representing the ID of the entry to be
+ // selected.
+ void HandleSelectArticle(const ListValue* args);
private:
// Factory for the creating refs in callbacks.
base::WeakPtrFactory<DomDistillerHandler> weak_ptr_factory_;
+ // The DomDistillerService.
+ DomDistillerService* service_;
+
+ // The scheme for DOM distiller articles.
+ std::string article_scheme_;
+
DISALLOW_COPY_AND_ASSIGN(DomDistillerHandler);
};
« no previous file with comments | « components/dom_distiller/core/task_tracker.cc ('k') | components/dom_distiller/webui/dom_distiller_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698