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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 ConvertEvent(event, device_pixel_ratio_); | 164 ConvertEvent(event, device_pixel_ratio_); |
165 if (!web_event) | 165 if (!web_event) |
166 return; | 166 return; |
167 if (sky_view_) | 167 if (sky_view_) |
168 sky_view_->HandleInputEvent(*web_event); | 168 sky_view_->HandleInputEvent(*web_event); |
169 if (web_view_) | 169 if (web_view_) |
170 web_view_->handleInputEvent(*web_event); | 170 web_view_->handleInputEvent(*web_event); |
171 } | 171 } |
172 | 172 |
173 void Engine::LoadURL(const mojo::String& url) { | 173 void Engine::LoadURL(const mojo::String& url) { |
174 // Enable SkyView here. | 174 if (!WebView::shouldUseWebView(responseURL)) { |
175 if (false) { | |
176 sky_view_ = blink::SkyView::Create(this); | 175 sky_view_ = blink::SkyView::Create(this); |
177 sky_view_->Load(GURL(url)); | 176 sky_view_->Load(GURL(url)); |
178 return; | 177 return; |
179 } | 178 } |
180 | 179 |
| 180 LOG(WARNING) << ".sky support is deprecated, please use .dart for main()"; |
| 181 |
181 // Something bad happens if you try to call WebView::close and replace | 182 // Something bad happens if you try to call WebView::close and replace |
182 // the webview. So for now we just load into the existing one. :/ | 183 // the webview. So for now we just load into the existing one. :/ |
183 if (!web_view_) | 184 if (!web_view_) |
184 web_view_ = blink::WebView::create(this); | 185 web_view_ = blink::WebView::create(this); |
185 ConfigureSettings(web_view_->settings()); | 186 ConfigureSettings(web_view_->settings()); |
186 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); | 187 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
187 UpdateWebViewSize(); | 188 UpdateWebViewSize(); |
188 web_view_->mainFrame()->load(GURL(url)); | 189 web_view_->mainFrame()->load(GURL(url)); |
189 } | 190 } |
190 | 191 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 228 |
228 void Engine::DidNavigateLocally(const mojo::String& url) { | 229 void Engine::DidNavigateLocally(const mojo::String& url) { |
229 } | 230 } |
230 | 231 |
231 void Engine::RequestNavigateHistory(int32_t delta) { | 232 void Engine::RequestNavigateHistory(int32_t delta) { |
232 NOTIMPLEMENTED(); | 233 NOTIMPLEMENTED(); |
233 } | 234 } |
234 | 235 |
235 } // namespace shell | 236 } // namespace shell |
236 } // namespace sky | 237 } // namespace sky |
OLD | NEW |