diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-29 18:35:42 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-29 18:35:42 +0000 |
commit | 9527f9cc2bd9ea407c72b35e016b848b6ea4ecff (patch) | |
tree | 8936410a87641d2fa31f956df00add071a62f2c4 /chrome/browser | |
parent | c6d972b5b5967c090671d6a9fb9dd05252d2f8f5 (diff) | |
download | chromium_src-9527f9cc2bd9ea407c72b35e016b848b6ea4ecff.zip chromium_src-9527f9cc2bd9ea407c72b35e016b848b6ea4ecff.tar.gz chromium_src-9527f9cc2bd9ea407c72b35e016b848b6ea4ecff.tar.bz2 |
Change chrome:// to chrome-ui://, fix up one chrome-resource:// reference.
Review URL: http://codereview.chromium.org/18175
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 2 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser_url_handler.cc | 2 | ||||
-rw-r--r-- | chrome/browser/browsing_instance.cc | 2 | ||||
-rw-r--r-- | chrome/browser/debugger/debugger_contents.cc | 2 | ||||
-rw-r--r-- | chrome/browser/debugger/debugger_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/dom_ui/chrome_url_data_manager.cc | 4 | ||||
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_contents.cc | 11 | ||||
-rw-r--r-- | chrome/browser/dom_ui/dom_ui_contents.h | 2 | ||||
-rw-r--r-- | chrome/browser/dom_ui/history_ui.cc | 5 | ||||
-rw-r--r-- | chrome/browser/renderer_host/renderer_security_policy.cc | 10 | ||||
-rw-r--r-- | chrome/browser/renderer_host/renderer_security_policy_unittest.cc | 12 | ||||
-rw-r--r-- | chrome/browser/resources/history.html | 4 | ||||
-rw-r--r-- | chrome/browser/resources/new_tab.html | 23 |
14 files changed, 44 insertions, 41 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 8c01f75..91df8c4 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -199,7 +199,7 @@ bool BrowserAboutHandler::MaybeHandle(GURL* url, return false; *result_type = TAB_CONTENTS_ABOUT_UI; - std::string about_url = "chrome://about/"; + std::string about_url = "chrome-ui://about/"; about_url.append(url->path()); *url = GURL(about_url); return true; diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 980ae97..c09f99f 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -447,8 +447,8 @@ int BrowserMain(const MainFunctionParams& parameters) { // Config the network module so it has access to resources. net::NetModule::SetResourceProvider(NetResourceProvider); - // Register our global network handler for chrome:// and chrome-extension:// - // URLs. + // Register our global network handler for chrome-ui:// and + // chrome-extension:// URLs. RegisterURLRequestChromeJob(); RegisterExtensionProtocols(); diff --git a/chrome/browser/browser_url_handler.cc b/chrome/browser/browser_url_handler.cc index 555d065..1cc4344 100644 --- a/chrome/browser/browser_url_handler.cc +++ b/chrome/browser/browser_url_handler.cc @@ -20,7 +20,7 @@ void BrowserURLHandler::InitURLHandlers() { url_handlers_.push_back(&BrowserAboutHandler::MaybeHandle); // chrome-internal:* url_handlers_.push_back(&NewTabUIHandleURL); - // chrome:* + // chrome-ui:* url_handlers_.push_back(&DOMUIContentsCanHandleURL); } diff --git a/chrome/browser/browsing_instance.cc b/chrome/browser/browsing_instance.cc index f15deca..90a61e4 100644 --- a/chrome/browser/browsing_instance.cc +++ b/chrome/browser/browsing_instance.cc @@ -28,7 +28,7 @@ bool BrowsingInstance::ShouldUseProcessPerSite(const GURL& url) { // Note that --single-process may have been specified, but that affects the // process creation logic in RenderProcessHost, so we do not need to worry // about it here. - if (url.SchemeIs("chrome")) + if (url.SchemeIs("chrome-ui")) // Always consolidate instances of the new tab page (and instances of any // other internal resource urls). return true; diff --git a/chrome/browser/debugger/debugger_contents.cc b/chrome/browser/debugger/debugger_contents.cc index c3d2e4b..a8f62fa 100644 --- a/chrome/browser/debugger/debugger_contents.cc +++ b/chrome/browser/debugger/debugger_contents.cc @@ -127,6 +127,6 @@ void DebuggerContents::AttachMessageHandlers() { // static bool DebuggerContents::IsDebuggerUrl(const GURL& url) { - return (url.SchemeIs("chrome") && url.host() == "inspector"); + return (url.SchemeIs("chrome-ui") && url.host() == "inspector"); } diff --git a/chrome/browser/debugger/debugger_view.cc b/chrome/browser/debugger/debugger_view.cc index 662deef..18a8104 100644 --- a/chrome/browser/debugger/debugger_view.cc +++ b/chrome/browser/debugger/debugger_view.cc @@ -105,7 +105,7 @@ void DebuggerView::OnInit() { web_container_->SetTabContents(web_contents_); web_contents_->render_view_host()->AllowDOMUIBindings(); - GURL contents("chrome://inspector/debugger.html"); + GURL contents("chrome-ui://inspector/debugger.html"); web_contents_->controller()->LoadURL(contents, GURL(), PageTransition::START_PAGE); } diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.cc b/chrome/browser/dom_ui/chrome_url_data_manager.cc index 08f000d..b73b19a 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.cc +++ b/chrome/browser/dom_ui/chrome_url_data_manager.cc @@ -25,7 +25,7 @@ // The URL scheme used for internal chrome resources. // TODO(glen): Choose a better location for this. -static const char kChromeURLScheme[] = "chrome"; +static const char kChromeURLScheme[] = "chrome-ui"; // The single global instance of ChromeURLDataManager. ChromeURLDataManager chrome_url_data_manager; @@ -131,7 +131,7 @@ void ChromeURLDataManager::URLToRequest(const GURL& url, return; } - // Our input looks like: chrome://source_name/extra_bits?foo . + // Our input looks like: chrome-ui://source_name/extra_bits?foo . // So the url's "host" is our source, and everything after the host is // the path. source_name->assign(url.host()); diff --git a/chrome/browser/dom_ui/dom_ui_contents.cc b/chrome/browser/dom_ui/dom_ui_contents.cc index a32a4cd..4e0a3f2 100644 --- a/chrome/browser/dom_ui/dom_ui_contents.cc +++ b/chrome/browser/dom_ui/dom_ui_contents.cc @@ -12,7 +12,7 @@ // The scheme used for DOMUIContentses // TODO(glen): Merge this with the scheme in chrome_url_data_manager -static const char kURLScheme[] = "chrome"; +static const char kURLScheme[] = "chrome-ui"; // The path used in internal URLs to thumbnail data. static const char kThumbnailPath[] = "thumb"; @@ -117,9 +117,9 @@ void ThumbnailSource::OnThumbnailDataAvailable( /////////////////////////////////////////////////////////////////////////////// // DOMUIContents -// This is the top-level URL handler for chrome: URLs, and exposed in -// our header file. The individual DOMUIs provide a chrome: -// HTML source at the same host/path. +// This is the top-level URL handler for chrome-ui: URLs, and exposed in +// our header file. The individual DOMUIs provide a chrome-ui:// HTML source +// at the same host/path. bool DOMUIContentsCanHandleURL(GURL* url, TabContentsType* result_type) { if (!url->SchemeIs(kURLScheme)) @@ -205,4 +205,5 @@ void DOMUIContents::ProcessDOMUIMessage(const std::string& message, // static const std::string DOMUIContents::GetScheme() { return kURLScheme; -}
\ No newline at end of file +} + diff --git a/chrome/browser/dom_ui/dom_ui_contents.h b/chrome/browser/dom_ui/dom_ui_contents.h index 4712552..8042189 100644 --- a/chrome/browser/dom_ui/dom_ui_contents.h +++ b/chrome/browser/dom_ui/dom_ui_contents.h @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Contains code for managing local HTML UI at chrome:// URLs. +// Contains code for managing local HTML UI at chrome-ui:// URLs. #ifndef CHROME_BROWSER_DOM_UI_CONTENTS_H__ #define CHROME_BROWSER_DOM_UI_CONTENTS_H__ diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index c9226a7..da36fc7 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -24,8 +24,7 @@ using base::Time; -// HistoryUI is accessible from chrome://history, and the raw HTML is -// accessed from chrome://history. +// HistoryUI is accessible from chrome-ui://history. static const char kHistoryHost[] = "history"; // Maximum number of search results to return in a given search. We should @@ -287,7 +286,7 @@ void HistoryUI::Init() { HistoryUIHTMLSource* html_source = new HistoryUIHTMLSource(); - // Set up the chrome://history/ source. + // Set up the chrome-ui://history/ source. g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, NewRunnableMethod(&chrome_url_data_manager, &ChromeURLDataManager::AddDataSource, diff --git a/chrome/browser/renderer_host/renderer_security_policy.cc b/chrome/browser/renderer_host/renderer_security_policy.cc index ccea740..108ef61 100644 --- a/chrome/browser/renderer_host/renderer_security_policy.cc +++ b/chrome/browser/renderer_host/renderer_security_policy.cc @@ -195,9 +195,9 @@ void RendererSecurityPolicy::GrantInspectElement(int renderer_id) { if (state == security_state_.end()) return; - // The inspector is served from a chrome: URL. In order to run the - // inspector, the renderer needs to be able to load chrome URLs. - state->second->GrantScheme("chrome"); + // The inspector is served from a chrome-ui: URL. In order to run the + // inspector, the renderer needs to be able to load chrome-ui URLs. + state->second->GrantScheme("chrome-ui"); } void RendererSecurityPolicy::GrantDOMUIBindings(int renderer_id) { @@ -209,8 +209,8 @@ void RendererSecurityPolicy::GrantDOMUIBindings(int renderer_id) { state->second->GrantDOMUIBindings(); - // DOM UI bindings need the ability to request chrome URLs. - state->second->GrantScheme("chrome"); + // DOM UI bindings need the ability to request chrome-ui URLs. + state->second->GrantScheme("chrome-ui"); // DOM UI pages can contain links to file:// URLs. state->second->GrantScheme("file"); diff --git a/chrome/browser/renderer_host/renderer_security_policy_unittest.cc b/chrome/browser/renderer_host/renderer_security_policy_unittest.cc index ae3ac52..a098112 100644 --- a/chrome/browser/renderer_host/renderer_security_policy_unittest.cc +++ b/chrome/browser/renderer_host/renderer_security_policy_unittest.cc @@ -14,12 +14,12 @@ class RendererSecurityPolicyTest : public testing::Test { protected: // testing::Test virtual void SetUp() { - // In the real world, "chrome" is a handled scheme. - URLRequest::RegisterProtocolFactory("chrome", + // In the real world, "chrome-ui" is a handled scheme. + URLRequest::RegisterProtocolFactory("chrome-ui", &URLRequestTestJob::Factory); } virtual void TearDown() { - URLRequest::RegisterProtocolFactory("chrome", NULL); + URLRequest::RegisterProtocolFactory("chrome-ui", NULL); } }; @@ -70,7 +70,7 @@ TEST_F(RendererSecurityPolicyTest, StandardSchemesTest) { EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("view-cache:http://www.google.com/"))); EXPECT_FALSE(p->CanRequestURL(kRendererID, - GURL("chrome://foo/bar"))); + GURL("chrome-ui://foo/bar"))); p->Remove(kRendererID); } @@ -203,7 +203,7 @@ TEST_F(RendererSecurityPolicyTest, CanUploadFiles) { TEST_F(RendererSecurityPolicyTest, CanServiceInspectElement) { RendererSecurityPolicy* p = RendererSecurityPolicy::GetInstance(); - GURL url("chrome://inspector/inspector.html"); + GURL url("chrome-ui://inspector/inspector.html"); p->Add(kRendererID); @@ -217,7 +217,7 @@ TEST_F(RendererSecurityPolicyTest, CanServiceInspectElement) { TEST_F(RendererSecurityPolicyTest, CanServiceDOMUIBindings) { RendererSecurityPolicy* p = RendererSecurityPolicy::GetInstance(); - GURL url("chrome://thumb/http://www.google.com/"); + GURL url("chrome-ui://thumb/http://www.google.com/"); p->Add(kRendererID); diff --git a/chrome/browser/resources/history.html b/chrome/browser/resources/history.html index d86d6fe..b299fac 100644 --- a/chrome/browser/resources/history.html +++ b/chrome/browser/resources/history.html @@ -147,7 +147,7 @@ Page.prototype.getTitleHTML_ = function() { return '<div class="title">' + '<a ' + 'href="' + this.url_ + '" ' + - 'style="background-image:url(chrome://favicon/' + + 'style="background-image:url(chrome-ui://favicon/' + this.url_ + ')" ' + '>' + this.getHighlightedTitle_() + @@ -515,7 +515,7 @@ HistoryView.prototype.displayNavBar_ = function() { */ HistoryView.prototype.createPageNavHTML_ = function(page, name) { var hashString = PageState.getHashString(this.model_.getSearchText(), page); - return '<a href="chrome://history/' + + return '<a href="chrome-ui://history/' + (hashString ? '#' + hashString : '') + '"' + 'class="page-navigation"' + diff --git a/chrome/browser/resources/new_tab.html b/chrome/browser/resources/new_tab.html index 294b714..c04c047 100644 --- a/chrome/browser/resources/new_tab.html +++ b/chrome/browser/resources/new_tab.html @@ -225,7 +225,7 @@ html[dir='rtl'] #mostvisited td { -webkit-transition:all 0.12s; } .thumbnail-title { - background-image:url(chrome://favicon/); + background-image:url(chrome-ui://favicon/); display:block; background-repeat:no-repeat; background-size:16px; @@ -441,7 +441,7 @@ document.addEventListener('DOMContentLoaded', handleDOMContentLoaded); <form onsubmit="chrome.send('searchHistoryPage', [this.search.value]); return false;"> <input type="text" class="hint" name="search" - style="background-image:url(chrome://favicon/);" + style="background-image:url(chrome-ui://favicon/);" jsvalues="value:searchhistory" onfocus="handleInputFocus.apply(this);" onblur="handleInputBlur.apply(this);" /> @@ -524,12 +524,12 @@ function makeMostVisitedDOM(page, number) { /* Create the thumbnail */ var img_thumbnail = DOM('img', {className:'thumbnail'}); img_thumbnail.setAttribute('onload', "logEvent('image loaded');"); - img_thumbnail.src = 'chrome://thumb/' + page.url; + img_thumbnail.src = 'chrome-ui://thumb/' + page.url; /* Create the title */ var div_title = DOM('div', {className:'thumbnail-title'}); div_title.style.backgroundImage = - 'url("chrome://favicon/' + page.url + '")'; + 'url("chrome-ui://favicon/' + page.url + '")'; if (page.title) { div_title.appendChild(document.createTextNode(page.title)); } else { @@ -592,7 +592,7 @@ function makeSearchURL(url) { /* The HTML we want looks like this: <form> <input type="text" class="hint" - style="background-image:url(chrome://favicon/"+url+");" + style="background-image:url(chrome-ui://favicon/"+url+");" value="Search Wikipedia" onfocus="handleInputFocus();" onblur="handleInputBlur();" /> @@ -605,10 +605,10 @@ function makeSearchURL(url) { if (url.favIconURL) { input.style.backgroundImage = - 'url("chrome://favicon/iconurl/' + url.favIconURL + '")'; + 'url("chrome-ui://favicon/iconurl/' + url.favIconURL + '")'; } else { input.style.backgroundImage = - 'url("chrome://favicon/http://' + url.short_name + '")'; + 'url("chrome-ui://favicon/http://' + url.short_name + '")'; } input.onfocus = handleInputFocus; @@ -663,7 +663,7 @@ function renderRecentlyBookmarked(entries) { chrome.send("metrics", ["NTP_Bookmark" + i]) }, false); link.style.backgroundImage = - 'url("chrome://favicon/' + entry.url + '")'; + 'url("chrome-ui://favicon/' + entry.url + '")'; link.appendChild(document.createTextNode(entry.title)); container.appendChild(link); } @@ -703,7 +703,10 @@ function renderRecentlyClosedTabs(entries) { linkSpan.appendChild(document.createTextNode(" (")); for (var windowIndex = 0; windowIndex < entry.tabs.length; windowIndex++) { var tab = entry.tabs[windowIndex]; - var tabImg = DOM('img', {src:'url("chrome://favicon/' + tab.url + '")', width:16, height:16, }); + var tabImg = DOM('img', { + src:'url("chrome-ui://favicon/' + tab.url + '")', + width:16, + height:16}); linkSpan.appendChild(tabImg); } linkSpan.appendChild(document.createTextNode(")")); @@ -751,7 +754,7 @@ function createRecentBookmark(tagName, data) { var link = DOM(tagName, {className:'recent-bookmark', title:data.title}); if (tagName == 'a') link.href = data.url; - link.style.backgroundImage = 'url("chrome://favicon/' + data.url + '")'; + link.style.backgroundImage = 'url("chrome-ui://favicon/' + data.url + '")'; link.appendChild(document.createTextNode(data.title)); return link; } |