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

Unified Diff: sky/viewer/document_view.cc

Issue 1152313002: Make SkyView vs. WebView controlable via url path (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/ui/engine.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/document_view.cc
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
index f9fe5de87d6624e09fc811293cce3cc7589cf4fb..e8eda02094c09d9f14c7547684121ce2270cdf3f 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -158,21 +158,24 @@ void DocumentView::OnEmbed(
void DocumentView::OnViewManagerDisconnected(mojo::ViewManager* view_manager) {
// TODO(aa): Need to figure out how shutdown works.
}
-
void DocumentView::Load(mojo::URLResponsePtr response) {
- // Enable SkyView here.
- if (false) {
+ GURL responseURL(response->url);
+
+ if (!blink::WebView::shouldUseWebView(responseURL)) {
sky_view_ = blink::SkyView::Create(this);
initializeLayerTreeView();
- sky_view_->Load(GURL(response->url), response.Pass());
+ sky_view_->Load(responseURL, response.Pass());
return;
}
+ if (!RuntimeFlags::Get().testing())
+ LOG(WARNING) << ".sky support is deprecated, please use .dart for main()";
+
web_view_ = blink::WebView::create(this);
ConfigureSettings(web_view_->settings());
web_view_->setMainFrame(blink::WebLocalFrame::create(this));
web_view_->mainFrame()->loadFromDataPipeWithURL(
- response->body.Pass(), GURL(response->url));
+ response->body.Pass(), responseURL);
}
void DocumentView::initializeLayerTreeView() {
« no previous file with comments | « sky/shell/ui/engine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698