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

Side by Side Diff: mojo/services/html_viewer/html_document_view.cc

Issue 699123003: mojo: Fix html_viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "mojo/services/html_viewer/html_document_view.h" 5 #include "mojo/services/html_viewer/html_document_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 return false; 82 return false;
83 } 83 }
84 84
85 } // namespace 85 } // namespace
86 86
87 HTMLDocumentView::HTMLDocumentView( 87 HTMLDocumentView::HTMLDocumentView(
88 URLResponsePtr response, 88 URLResponsePtr response,
89 ShellPtr shell, 89 ShellPtr shell,
90 scoped_refptr<base::MessageLoopProxy> compositor_thread, 90 scoped_refptr<base::MessageLoopProxy> compositor_thread,
91 WebMediaPlayerFactory* web_media_player_factory) 91 WebMediaPlayerFactory* web_media_player_factory)
92 : shell_(shell.Pass()), 92 : response_(response.Pass()),
93 shell_(shell.Pass()),
93 web_view_(NULL), 94 web_view_(NULL),
94 root_(NULL), 95 root_(NULL),
95 view_manager_client_factory_(shell_.get(), this), 96 view_manager_client_factory_(shell_.get(), this),
96 compositor_thread_(compositor_thread), 97 compositor_thread_(compositor_thread),
97 web_media_player_factory_(web_media_player_factory), 98 web_media_player_factory_(web_media_player_factory),
98 weak_factory_(this) { 99 weak_factory_(this) {
99 Load(response.Pass()); 100 shell_.set_client(this);
100 } 101 }
101 102
102 HTMLDocumentView::~HTMLDocumentView() { 103 HTMLDocumentView::~HTMLDocumentView() {
103 if (web_view_) 104 if (web_view_)
104 web_view_->close(); 105 web_view_->close();
105 if (root_) 106 if (root_)
106 root_->RemoveObserver(this); 107 root_->RemoveObserver(this);
107 } 108 }
108 109
109 void HTMLDocumentView::AcceptConnection(const String& requestor_url, 110 void HTMLDocumentView::AcceptConnection(const String& requestor_url,
110 ServiceProviderPtr provider) { 111 ServiceProviderPtr provider) {
111 exported_services_.AddService(&view_manager_client_factory_); 112 exported_services_.AddService(&view_manager_client_factory_);
112 WeakBindToPipe(&exported_services_, provider.PassMessagePipe()); 113 WeakBindToPipe(&exported_services_, provider.PassMessagePipe());
114 Load(response_.Pass());
113 } 115 }
114 116
115 void HTMLDocumentView::Initialize(Array<String> args) { 117 void HTMLDocumentView::Initialize(Array<String> args) {
116 } 118 }
117 119
118 void HTMLDocumentView::OnEmbed( 120 void HTMLDocumentView::OnEmbed(
119 ViewManager* view_manager, 121 ViewManager* view_manager,
120 View* root, 122 View* root,
121 ServiceProviderImpl* embedee_service_provider_impl, 123 ServiceProviderImpl* embedee_service_provider_impl,
122 scoped_ptr<ServiceProvider> embedder_service_provider) { 124 scoped_ptr<ServiceProvider> embedder_service_provider) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 261 }
260 262
261 void HTMLDocumentView::OnViewInputEvent(View* view, const EventPtr& event) { 263 void HTMLDocumentView::OnViewInputEvent(View* view, const EventPtr& event) {
262 scoped_ptr<blink::WebInputEvent> web_event = 264 scoped_ptr<blink::WebInputEvent> web_event =
263 event.To<scoped_ptr<blink::WebInputEvent> >(); 265 event.To<scoped_ptr<blink::WebInputEvent> >();
264 if (web_event) 266 if (web_event)
265 web_view_->handleInputEvent(*web_event); 267 web_view_->handleInputEvent(*web_event);
266 } 268 }
267 269
268 } // namespace mojo 270 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698