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

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

Issue 1163323007: Make it possible to navigate from a SkyView to a WebView. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « mojo/tools/deploy_domokit_site.py ('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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « mojo/tools/deploy_domokit_site.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698