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

Unified Diff: sky/engine/web/WebViewImpl.cpp

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/engine/public/web/WebView.h ('k') | sky/shell/ui/engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/web/WebViewImpl.cpp
diff --git a/sky/engine/web/WebViewImpl.cpp b/sky/engine/web/WebViewImpl.cpp
index 342bd53d669941333e55d8b6bf7a87d318f1cf67..10ae28b364b37bb7314b6a3e1fc046b55505e255 100644
--- a/sky/engine/web/WebViewImpl.cpp
+++ b/sky/engine/web/WebViewImpl.cpp
@@ -83,6 +83,7 @@
#include "sky/engine/wtf/CurrentTime.h"
#include "sky/engine/wtf/RefPtr.h"
#include "sky/engine/wtf/TemporaryChange.h"
+#include "url/gurl.h"
// Get rid of WTF's pow define so we can use std::pow.
#undef pow
@@ -92,6 +93,20 @@ namespace blink {
// WebView ----------------------------------------------------------------
+bool WebView::shouldUseWebView(const GURL& url)
+{
+ std::string filename = url.ExtractFileName();
+ int hashStart = filename.find('#');
+ if (hashStart != -1)
+ filename.resize(hashStart);
+ int queryStart = filename.find('?');
+ if (queryStart != -1)
+ filename.resize(queryStart);
+ // For now .dart indicates we should use SkyView. Eventually we'll
+ // use SkyView for all urls regardless of file extension.
+ return !EndsWith(filename, ".dart", false);
+}
+
WebView* WebView::create(WebViewClient* client)
{
// Pass the WebViewImpl's self-reference to the caller.
« no previous file with comments | « sky/engine/public/web/WebView.h ('k') | sky/shell/ui/engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698