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

Side by Side Diff: sky/shell/ui/engine.cc

Issue 1129333005: Plumb input events into SkyView (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « sky/examples/raw/hello_world.dart ('k') | 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/shell/ui/engine.h" 5 #include "sky/shell/ui/engine.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "mojo/public/cpp/application/connect.h" 9 #include "mojo/public/cpp/application/connect.h"
10 #include "sky/engine/public/platform/WebInputEvent.h" 10 #include "sky/engine/public/platform/WebInputEvent.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 screen.deviceScaleFactor = device_pixel_ratio_; 154 screen.deviceScaleFactor = device_pixel_ratio_;
155 return screen; 155 return screen;
156 } 156 }
157 157
158 void Engine::OnInputEvent(InputEventPtr event) { 158 void Engine::OnInputEvent(InputEventPtr event) {
159 TRACE_EVENT0("sky", "Engine::OnInputEvent"); 159 TRACE_EVENT0("sky", "Engine::OnInputEvent");
160 scoped_ptr<blink::WebInputEvent> web_event = 160 scoped_ptr<blink::WebInputEvent> web_event =
161 ConvertEvent(event, device_pixel_ratio_); 161 ConvertEvent(event, device_pixel_ratio_);
162 if (!web_event) 162 if (!web_event)
163 return; 163 return;
164 if (sky_view_)
165 sky_view_->HandleInputEvent(*web_event);
164 if (web_view_) 166 if (web_view_)
165 web_view_->handleInputEvent(*web_event); 167 web_view_->handleInputEvent(*web_event);
166 } 168 }
167 169
168 void Engine::LoadURL(const mojo::String& url) { 170 void Engine::LoadURL(const mojo::String& url) {
169 // Enable SkyView here. 171 // Enable SkyView here.
170 if (false) { 172 if (true) {
eseidel 2015/05/19 23:49:00 You don't want this.
171 sky_view_ = blink::SkyView::Create(this); 173 sky_view_ = blink::SkyView::Create(this);
172 sky_view_->Load(GURL(url)); 174 sky_view_->Load(GURL(url));
173 return; 175 return;
174 } 176 }
175 177
176 // Something bad happens if you try to call WebView::close and replace 178 // Something bad happens if you try to call WebView::close and replace
177 // the webview. So for now we just load into the existing one. :/ 179 // the webview. So for now we just load into the existing one. :/
178 if (!web_view_) 180 if (!web_view_)
179 web_view_ = blink::WebView::create(this); 181 web_view_ = blink::WebView::create(this);
180 ConfigureSettings(web_view_->settings()); 182 ConfigureSettings(web_view_->settings());
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 224
223 void Engine::DidNavigateLocally(const mojo::String& url) { 225 void Engine::DidNavigateLocally(const mojo::String& url) {
224 } 226 }
225 227
226 void Engine::RequestNavigateHistory(int32_t delta) { 228 void Engine::RequestNavigateHistory(int32_t delta) {
227 NOTIMPLEMENTED(); 229 NOTIMPLEMENTED();
228 } 230 }
229 231
230 } // namespace shell 232 } // namespace shell
231 } // namespace sky 233 } // namespace sky
OLDNEW
« no previous file with comments | « sky/examples/raw/hello_world.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698