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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 scoped_ptr<blink::WebInputEvent> web_event = | 163 scoped_ptr<blink::WebInputEvent> web_event = |
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& mojo_url) { |
174 if (!WebView::shouldUseWebView(responseURL)) { | 174 GURL url(mojo_url); |
| 175 if (!blink::WebView::shouldUseWebView(url)) { |
175 sky_view_ = blink::SkyView::Create(this); | 176 sky_view_ = blink::SkyView::Create(this); |
176 sky_view_->Load(GURL(url)); | 177 sky_view_->Load(url); |
177 return; | 178 return; |
178 } | 179 } |
179 | 180 |
180 LOG(WARNING) << ".sky support is deprecated, please use .dart for main()"; | 181 LOG(WARNING) << ".sky support is deprecated, please use .dart for main()"; |
181 | 182 |
182 // Something bad happens if you try to call WebView::close and replace | 183 // Something bad happens if you try to call WebView::close and replace |
183 // the webview. So for now we just load into the existing one. :/ | 184 // the webview. So for now we just load into the existing one. :/ |
184 if (!web_view_) | 185 if (!web_view_) |
185 web_view_ = blink::WebView::create(this); | 186 web_view_ = blink::WebView::create(this); |
186 ConfigureSettings(web_view_->settings()); | 187 ConfigureSettings(web_view_->settings()); |
187 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); | 188 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
188 UpdateWebViewSize(); | 189 UpdateWebViewSize(); |
189 web_view_->mainFrame()->load(GURL(url)); | 190 web_view_->mainFrame()->load(url); |
190 } | 191 } |
191 | 192 |
192 void Engine::frameDetached(blink::WebFrame* frame) { | 193 void Engine::frameDetached(blink::WebFrame* frame) { |
193 // |frame| is invalid after here. | 194 // |frame| is invalid after here. |
194 frame->close(); | 195 frame->close(); |
195 } | 196 } |
196 | 197 |
197 void Engine::initializeLayerTreeView() { | 198 void Engine::initializeLayerTreeView() { |
198 } | 199 } |
199 | 200 |
(...skipping 28 matching lines...) Expand all Loading... |
228 | 229 |
229 void Engine::DidNavigateLocally(const mojo::String& url) { | 230 void Engine::DidNavigateLocally(const mojo::String& url) { |
230 } | 231 } |
231 | 232 |
232 void Engine::RequestNavigateHistory(int32_t delta) { | 233 void Engine::RequestNavigateHistory(int32_t delta) { |
233 NOTIMPLEMENTED(); | 234 NOTIMPLEMENTED(); |
234 } | 235 } |
235 | 236 |
236 } // namespace shell | 237 } // namespace shell |
237 } // namespace sky | 238 } // namespace sky |
OLD | NEW |