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/content/browser/distiller_javascript_service_impl.h

Issue 1231083007: Expose distiller functions to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-content
Patch Set: Move dependencies to correct files Created 5 years, 3 months 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/content/browser/distiller_javascript_service_impl.h
diff --git a/components/dom_distiller/content/browser/distiller_javascript_service_impl.h b/components/dom_distiller/content/browser/distiller_javascript_service_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..d21cd4a427dec8de8443191135021b9bc67d3923
--- /dev/null
+++ b/components/dom_distiller/content/browser/distiller_javascript_service_impl.h
@@ -0,0 +1,34 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IMPL_H_
+#define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IMPL_H_
+
+#include "components/dom_distiller/content/common/distiller_javascript_service.mojom.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/string.h"
+#include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h"
+
+namespace dom_distiller {
+
+// This is the receiving end of "distiller" JavaScript object calls.
+class DistillerJavaScriptServiceImpl : public DistillerJavaScriptService {
+ public:
+ DistillerJavaScriptServiceImpl(
+ mojo::InterfaceRequest<DistillerJavaScriptService> request);
+ ~DistillerJavaScriptServiceImpl() override;
+
+ // Mojo DistillerJavaScriptService implementation.
+ void HandleDistillerEchoCall(const mojo::String& message) override;
+
+ private:
+ mojo::StrongBinding<DistillerJavaScriptService> binding_;
+};
+
+// static
+void CreateDistillerJavaScriptService(
+ mojo::InterfaceRequest<DistillerJavaScriptService> request);
+
+} // namespace dom_distiller
+
+#endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLER_JAVASCRIPT_SERVICE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698