| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 if (web_view_) { | 178 if (web_view_) { |
| 179 web_view_->close(); | 179 web_view_->close(); |
| 180 web_view_ = nullptr; | 180 web_view_ = nullptr; |
| 181 } | 181 } |
| 182 sky_view_ = blink::SkyView::Create(this); | 182 sky_view_ = blink::SkyView::Create(this); |
| 183 sky_view_->Load(url); | 183 sky_view_->Load(url); |
| 184 UpdateSkyViewSize(); | 184 UpdateSkyViewSize(); |
| 185 return; | 185 return; |
| 186 } | 186 } |
| 187 | 187 |
| 188 if (sky_view_) |
| 189 sky_view_ = nullptr; |
| 190 |
| 188 LOG(WARNING) << ".sky support is deprecated, please use .dart for main()"; | 191 LOG(WARNING) << ".sky support is deprecated, please use .dart for main()"; |
| 189 | 192 |
| 190 // Something bad happens if you try to call WebView::close and replace | 193 // Something bad happens if you try to call WebView::close and replace |
| 191 // the webview. So for now we just load into the existing one. :/ | 194 // the webview. So for now we just load into the existing one. :/ |
| 192 if (!web_view_) | 195 if (!web_view_) |
| 193 web_view_ = blink::WebView::create(this); | 196 web_view_ = blink::WebView::create(this); |
| 194 ConfigureSettings(web_view_->settings()); | 197 ConfigureSettings(web_view_->settings()); |
| 195 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); | 198 web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
| 196 UpdateWebViewSize(); | 199 UpdateWebViewSize(); |
| 197 web_view_->mainFrame()->load(url); | 200 web_view_->mainFrame()->load(url); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 244 |
| 242 void Engine::DidNavigateLocally(const mojo::String& url) { | 245 void Engine::DidNavigateLocally(const mojo::String& url) { |
| 243 } | 246 } |
| 244 | 247 |
| 245 void Engine::RequestNavigateHistory(int32_t delta) { | 248 void Engine::RequestNavigateHistory(int32_t delta) { |
| 246 NOTIMPLEMENTED(); | 249 NOTIMPLEMENTED(); |
| 247 } | 250 } |
| 248 | 251 |
| 249 } // namespace shell | 252 } // namespace shell |
| 250 } // namespace sky | 253 } // namespace sky |
| OLD | NEW |