OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |