Commit 285f4bb8 authored by tfarina@chromium.org's avatar tfarina@chromium.org

content: Move more two url constants to content namespace.

R=jam@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10091023

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132582 0039d316-1c4b-4281-b951-d872f2087c98
parent bea17664
...@@ -1454,7 +1454,7 @@ void WebContentsImpl::OnDidStartProvisionalLoadForFrame(int64 frame_id, ...@@ -1454,7 +1454,7 @@ void WebContentsImpl::OnDidStartProvisionalLoadForFrame(int64 frame_id,
bool is_main_frame, bool is_main_frame,
const GURL& opener_url, const GURL& opener_url,
const GURL& url) { const GURL& url) {
bool is_error_page = (url.spec() == chrome::kUnreachableWebDataURL); bool is_error_page = (url.spec() == content::kUnreachableWebDataURL);
GURL validated_url(url); GURL validated_url(url);
GURL validated_opener_url(opener_url); GURL validated_opener_url(opener_url);
GetRenderViewHostImpl()->FilterURL( GetRenderViewHostImpl()->FilterURL(
......
...@@ -59,6 +59,10 @@ const char kChromeUIKillURL[] = "chrome://kill"; ...@@ -59,6 +59,10 @@ const char kChromeUIKillURL[] = "chrome://kill";
const char kChromeUINetworkViewCacheURL[] = "chrome://view-http-cache/"; const char kChromeUINetworkViewCacheURL[] = "chrome://view-http-cache/";
const char kChromeUIShorthangURL[] = "chrome://shorthang"; const char kChromeUIShorthangURL[] = "chrome://shorthang";
} // namespace chrome
namespace content {
// This error URL is loaded in normal web renderer processes, so it should not // This error URL is loaded in normal web renderer processes, so it should not
// have a chrome:// scheme that might let it be confused with a WebUI page. // have a chrome:// scheme that might let it be confused with a WebUI page.
const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata"; const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata";
...@@ -68,10 +72,6 @@ const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata"; ...@@ -68,10 +72,6 @@ const char kUnreachableWebDataURL[] = "data:text/html,chromewebdata";
// scripted by other pages in the process. // scripted by other pages in the process.
const char kSwappedOutURL[] = "swappedout://"; const char kSwappedOutURL[] = "swappedout://";
} // namespace chrome
namespace content {
const char** GetSavableSchemes() { const char** GetSavableSchemes() {
return const_cast<const char**>(g_savable_schemes); return const_cast<const char**>(g_savable_schemes);
} }
......
...@@ -52,16 +52,16 @@ CONTENT_EXPORT extern const char kChromeUIKillURL[]; ...@@ -52,16 +52,16 @@ CONTENT_EXPORT extern const char kChromeUIKillURL[];
CONTENT_EXPORT extern const char kChromeUINetworkViewCacheURL[]; CONTENT_EXPORT extern const char kChromeUINetworkViewCacheURL[];
CONTENT_EXPORT extern const char kChromeUIShorthangURL[]; CONTENT_EXPORT extern const char kChromeUIShorthangURL[];
} // namespace chrome
namespace content {
// Special URL used to start a navigation to an error page. // Special URL used to start a navigation to an error page.
extern const char kUnreachableWebDataURL[]; extern const char kUnreachableWebDataURL[];
// Special URL used to swap out a view being rendered by another process. // Special URL used to swap out a view being rendered by another process.
extern const char kSwappedOutURL[]; extern const char kSwappedOutURL[];
} // namespace chrome
namespace content {
// Null terminated list of schemes that are savable. This function can be // Null terminated list of schemes that are savable. This function can be
// invoked on any thread. // invoked on any thread.
CONTENT_EXPORT const char** GetSavableSchemes(); CONTENT_EXPORT const char** GetSavableSchemes();
......
...@@ -1390,8 +1390,8 @@ void RenderViewImpl::SendUpdateState(const WebHistoryItem& item) { ...@@ -1390,8 +1390,8 @@ void RenderViewImpl::SendUpdateState(const WebHistoryItem& item) {
if (item.isNull()) if (item.isNull())
return; return;
// Don't send state updates for chrome::kSwappedOutURL. // Don't send state updates for content::kSwappedOutURL.
if (item.urlString() == WebString::fromUTF8(chrome::kSwappedOutURL)) if (item.urlString() == WebString::fromUTF8(content::kSwappedOutURL))
return; return;
Send(new ViewHostMsg_UpdateState( Send(new ViewHostMsg_UpdateState(
...@@ -1430,7 +1430,7 @@ void RenderViewImpl::LoadNavigationErrorPage( ...@@ -1430,7 +1430,7 @@ void RenderViewImpl::LoadNavigationErrorPage(
} }
frame->loadHTMLString(*error_html, frame->loadHTMLString(*error_html,
GURL(chrome::kUnreachableWebDataURL), GURL(content::kUnreachableWebDataURL),
error.unreachableURL, error.unreachableURL,
replace); replace);
} }
...@@ -2281,7 +2281,7 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( ...@@ -2281,7 +2281,7 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation(
GetReferrerPolicyFromRequest(request)); GetReferrerPolicyFromRequest(request));
if (is_swapped_out_) { if (is_swapped_out_) {
if (request.url() != GURL(chrome::kSwappedOutURL)) { if (request.url() != GURL(content::kSwappedOutURL)) {
// Targeted links may try to navigate a swapped out frame. Allow the // Targeted links may try to navigate a swapped out frame. Allow the
// browser process to navigate the tab instead. Note that it is also // browser process to navigate the tab instead. Note that it is also
// possible for non-targeted navigations (from this view) to arrive // possible for non-targeted navigations (from this view) to arrive
...@@ -2299,7 +2299,7 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation( ...@@ -2299,7 +2299,7 @@ WebNavigationPolicy RenderViewImpl::decidePolicyForNavigation(
return WebKit::WebNavigationPolicyIgnore; return WebKit::WebNavigationPolicyIgnore;
} }
// Allow chrome::kSwappedOutURL to complete. // Allow content::kSwappedOutURL to complete.
return default_policy; return default_policy;
} }
...@@ -2853,13 +2853,13 @@ void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame, ...@@ -2853,13 +2853,13 @@ void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame,
// We bump our Page ID to correspond with the new session history entry. // We bump our Page ID to correspond with the new session history entry.
page_id_ = next_page_id_++; page_id_ = next_page_id_++;
// Don't update history_page_ids_ (etc) for chrome::kSwappedOutURL, since // Don't update history_page_ids_ (etc) for content::kSwappedOutURL, since
// we don't want to forget the entry that was there, and since we will // we don't want to forget the entry that was there, and since we will
// never come back to chrome::kSwappedOutURL. Note that we have to call // never come back to content::kSwappedOutURL. Note that we have to call
// UpdateSessionHistory and update page_id_ even in this case, so that // UpdateSessionHistory and update page_id_ even in this case, so that
// the current entry gets a state update and so that we don't send a // the current entry gets a state update and so that we don't send a
// state update to the wrong entry when we swap back in. // state update to the wrong entry when we swap back in.
if (GetLoadingUrl(frame) != GURL(chrome::kSwappedOutURL)) { if (GetLoadingUrl(frame) != GURL(content::kSwappedOutURL)) {
// Advance our offset in session history, applying the length limit. // Advance our offset in session history, applying the length limit.
// There is now no forward history. // There is now no forward history.
history_list_offset_++; history_list_offset_++;
...@@ -4447,15 +4447,15 @@ void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) { ...@@ -4447,15 +4447,15 @@ void RenderViewImpl::OnSwapOut(const ViewMsg_SwapOut_Params& params) {
// Swap out and stop sending any IPC messages that are not ACKs. // Swap out and stop sending any IPC messages that are not ACKs.
SetSwappedOut(true); SetSwappedOut(true);
// Replace the page with a blank dummy URL. The unload handler will not be // Replace the page with a blank dummy URL. The unload handler will not be
// run a second time, thanks to a check in FrameLoader::stopLoading. // run a second time, thanks to a check in FrameLoader::stopLoading.
// We use loadRequest instead of loadHTMLString because the former commits // We use loadRequest instead of loadHTMLString because the former commits
// synchronously. Otherwise a new navigation can interrupt the navigation // synchronously. Otherwise a new navigation can interrupt the navigation
// to chrome::kSwappedOutURL. If that happens to be to the page we had been // to content::kSwappedOutURL. If that happens to be to the page we had been
// showing, then WebKit will never send a commit and we'll be left spinning. // showing, then WebKit will never send a commit and we'll be left spinning.
// TODO(creis): Need to add a better way to do this that avoids running the // TODO(creis): Need to add a better way to do this that avoids running the
// beforeunload handler. For now, we just run it a second time silently. // beforeunload handler. For now, we just run it a second time silently.
GURL swappedOutURL(chrome::kSwappedOutURL); GURL swappedOutURL(content::kSwappedOutURL);
WebURLRequest request(swappedOutURL); WebURLRequest request(swappedOutURL);
webview()->mainFrame()->loadRequest(request); webview()->mainFrame()->loadRequest(request);
} }
...@@ -4528,7 +4528,7 @@ bool RenderViewImpl::MaybeLoadAlternateErrorPage(WebFrame* frame, ...@@ -4528,7 +4528,7 @@ bool RenderViewImpl::MaybeLoadAlternateErrorPage(WebFrame* frame,
// Load an empty page first so there is an immediate response to the error, // Load an empty page first so there is an immediate response to the error,
// and then kick off a request for the alternate error page. // and then kick off a request for the alternate error page.
frame->loadHTMLString(std::string(), frame->loadHTMLString(std::string(),
GURL(chrome::kUnreachableWebDataURL), GURL(content::kUnreachableWebDataURL),
error.unreachableURL, error.unreachableURL,
replace); replace);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment