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

Unified Diff: mojo/examples/html_viewer/html_document_view.h

Issue 340453002: Mojo: HTML Viewer based on Blink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build Created 6 years, 6 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
« no previous file with comments | « mojo/examples/html_viewer/blink_platform_impl.cc ('k') | mojo/examples/html_viewer/html_document_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/html_viewer/html_document_view.h
diff --git a/mojo/examples/html_viewer/html_document_view.h b/mojo/examples/html_viewer/html_document_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ad76e42dc4a05ef8f48acf7728e36ad888aedac
--- /dev/null
+++ b/mojo/examples/html_viewer/html_document_view.h
@@ -0,0 +1,62 @@
+// Copyright 2014 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 MOJO_EXAMPLES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_
+#define MOJO_EXAMPLES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_
+
+#include "base/memory/weak_ptr.h"
+#include "mojo/services/public/interfaces/network/url_loader.mojom.h"
+#include "third_party/WebKit/public/web/WebFrameClient.h"
+#include "third_party/WebKit/public/web/WebViewClient.h"
+
+namespace mojo {
+
+namespace view_manager {
+class Node;
+class ViewManager;
+class View;
+}
+
+namespace examples {
+
+// A view for a single HTML document.
+class HTMLDocumentView : public blink::WebViewClient,
+ public blink::WebFrameClient {
+ public:
+ explicit HTMLDocumentView(view_manager::ViewManager* view_manager);
+ virtual ~HTMLDocumentView();
+
+ void AttachToNode(view_manager::Node* node);
+
+ void Load(URLResponsePtr response,
+ ScopedDataPipeConsumerHandle response_body_stream);
+
+ private:
+ // WebWidgetClient methods:
+ virtual void didInvalidateRect(const blink::WebRect& rect);
+ virtual bool allowsBrokenNullLayerTreeView() const;
+
+ // WebFrameClient methods:
+ virtual void didAddMessageToConsole(
+ const blink::WebConsoleMessage& message,
+ const blink::WebString& source_name,
+ unsigned source_line,
+ const blink::WebString& stack_trace);
+
+ void Repaint();
+
+ view_manager::ViewManager* view_manager_;
+ view_manager::View* view_;
+ blink::WebView* web_view_;
+ bool repaint_pending_;
+
+ base::WeakPtrFactory<HTMLDocumentView> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(HTMLDocumentView);
+};
+
+} // namespace examples
+} // namespace mojo
+
+#endif // MOJO_EXAMPLES_HTML_VIEWER_HTML_DOCUMENT_VIEW_H_
« no previous file with comments | « mojo/examples/html_viewer/blink_platform_impl.cc ('k') | mojo/examples/html_viewer/html_document_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698