OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 #include "url/gurl.h" | 85 #include "url/gurl.h" |
86 | 86 |
87 // Get rid of WTF's pow define so we can use std::pow. | 87 // Get rid of WTF's pow define so we can use std::pow. |
88 #undef pow | 88 #undef pow |
89 #include <cmath> // for std::pow | 89 #include <cmath> // for std::pow |
90 | 90 |
91 namespace blink { | 91 namespace blink { |
92 | 92 |
93 // WebView ---------------------------------------------------------------- | 93 // WebView ---------------------------------------------------------------- |
94 | 94 |
95 bool WebView::shouldUseWebView(const GURL& url) | |
96 { | |
97 std::string filename = url.ExtractFileName(); | |
98 int hashStart = filename.find('#'); | |
99 if (hashStart != -1) | |
100 filename.resize(hashStart); | |
101 int queryStart = filename.find('?'); | |
102 if (queryStart != -1) | |
103 filename.resize(queryStart); | |
104 // For now .dart indicates we should use SkyView. Eventually we'll | |
105 // use SkyView for all urls regardless of file extension. | |
106 return !EndsWith(filename, ".dart", false) | |
107 && !EndsWith(filename, ".snapshot", false); | |
108 } | |
109 | |
110 WebView* WebView::create(WebViewClient* client) | 95 WebView* WebView::create(WebViewClient* client) |
111 { | 96 { |
97 CRASH(); // WebView is deprecated. Please use SkyView. | |
Hixie
2015/06/30 21:45:03
I'm assuming deleting WebView itself is the next s
| |
112 // Pass the WebViewImpl's self-reference to the caller. | 98 // Pass the WebViewImpl's self-reference to the caller. |
113 return WebViewImpl::create(client); | 99 return WebViewImpl::create(client); |
114 } | 100 } |
115 | 101 |
116 WebViewImpl* WebViewImpl::create(WebViewClient* client) | 102 WebViewImpl* WebViewImpl::create(WebViewClient* client) |
117 { | 103 { |
118 // Pass the WebViewImpl's self-reference to the caller. | 104 // Pass the WebViewImpl's self-reference to the caller. |
119 return adoptRef(new WebViewImpl(client)).leakRef(); | 105 return adoptRef(new WebViewImpl(client)).leakRef(); |
120 } | 106 } |
121 | 107 |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
820 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, | 806 void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState, |
821 bool isInitialState) { | 807 bool isInitialState) { |
822 if (!page()) | 808 if (!page()) |
823 return; | 809 return; |
824 | 810 |
825 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState = = WebPageVisibilityStateHidden); | 811 ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState = = WebPageVisibilityStateHidden); |
826 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int> (visibilityState)), isInitialState); | 812 m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int> (visibilityState)), isInitialState); |
827 } | 813 } |
828 | 814 |
829 } // namespace blink | 815 } // namespace blink |
OLD | NEW |