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. |