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

Side by Side Diff: sky/shell/ui/engine.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 unified diff | Download patch
« no previous file with comments | « sky/engine/web/WebViewImpl.cpp ('k') | sky/viewer/document_view.cc » ('j') | 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « sky/engine/web/WebViewImpl.cpp ('k') | sky/viewer/document_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698