summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser.cc3
-rw-r--r--chrome/browser/browser_about_handler.cc6
-rw-r--r--chrome/browser/crash_recovery_uitest.cc5
-rw-r--r--chrome/browser/history/history.cc3
-rw-r--r--chrome/browser/history/url_database.cc3
-rw-r--r--chrome/browser/renderer_host/render_view_host_unittest.cc5
-rw-r--r--chrome/browser/renderer_host/renderer_security_policy_unittest.cc24
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc3
-rw-r--r--chrome/browser/site_instance_unittest.cc6
-rw-r--r--chrome/browser/tab_contents/navigation_controller.cc3
-rw-r--r--chrome/browser/tab_contents/site_instance.cc12
-rw-r--r--chrome/browser/task_manager.cc3
-rw-r--r--chrome/browser/toolbar_model.cc4
13 files changed, 37 insertions, 43 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 6f1bf44..7e1268f 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -34,7 +34,6 @@
#include "chrome/common/page_transition_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
-#include "chrome/common/url_constants.h"
#ifdef CHROME_PERSONALIZATION
#include "chrome/personalization/personalization.h"
#endif
@@ -2285,7 +2284,7 @@ NavigationController* Browser::BuildRestoredNavigationController(
} else {
// No navigations. Create a tab with about:blank.
TabContents* contents =
- CreateTabContentsForURL(GURL(chrome::kAboutBlankURL), GURL(), profile_,
+ CreateTabContentsForURL(GURL("about:blank"), GURL(), profile_,
PageTransition::START_PAGE, false, NULL);
return new NavigationController(contents, profile_);
}
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 0d83902..7f25a60 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -169,7 +169,7 @@ bool BrowserAboutHandler::MaybeHandle(GURL* url,
// about:blank is special. Frames are allowed to access about:blank,
// but they are not allowed to access other types of about pages.
// Just ignore the about:blank and let the TAB_CONTENTS_WEB handle it.
- if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutBlankURL)) {
+ if (StringToLowerASCII(url->path()) == "blank") {
return false;
}
@@ -192,7 +192,7 @@ bool BrowserAboutHandler::MaybeHandle(GURL* url,
// Navigate the renderer to about:blank. This is kind of stupid but is the
// easiest thing to do in this situation without adding a lot of complexity
// for this developer-only feature.
- *url = GURL(chrome::kAboutBlankURL);
+ *url = GURL("about:blank");
return false;
}
@@ -205,7 +205,7 @@ bool BrowserAboutHandler::MaybeHandle(GURL* url,
NOTIMPLEMENTED();
// TODO(port) Implement this.
#endif
- *url = GURL(chrome::kAboutBlankURL);
+ *url = GURL("about:blank");
return false;
}
#endif
diff --git a/chrome/browser/crash_recovery_uitest.cc b/chrome/browser/crash_recovery_uitest.cc
index 0355ec0..d094124 100644
--- a/chrome/browser/crash_recovery_uitest.cc
+++ b/chrome/browser/crash_recovery_uitest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/file_util.h"
-#include "chrome/common/url_constants.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
@@ -31,7 +30,7 @@ TEST_F(CrashRecoveryUITest, Reload) {
// Cause the renderer to crash.
expected_crashes_ = 1;
- tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL));
+ tab->NavigateToURLAsync(GURL("about:crash"));
Sleep(1000); // Wait for the browser to notice the renderer crash.
@@ -64,7 +63,7 @@ TEST_F(CrashRecoveryUITest, LoadInNewTab) {
// Cause the renderer to crash.
expected_crashes_ = 1;
- tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL));
+ tab->NavigateToURLAsync(GURL("about:crash"));
Sleep(1000); // Wait for the browser to notice the renderer crash.
diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc
index ced7b64..49707cf 100644
--- a/chrome/browser/history/history.cc
+++ b/chrome/browser/history/history.cc
@@ -578,7 +578,8 @@ bool HistoryService::CanAddURL(const GURL& url) const {
return false;
if (url.SchemeIs(chrome::kAboutScheme)) {
- if (LowerCaseEqualsASCII(url.spec(), chrome::kAboutBlankURL))
+ std::string path = url.path();
+ if (path.empty() || LowerCaseEqualsASCII(path, "blank"))
return false;
// We allow all other about URLs since the user may like to see things
// like "about:memory" or "about:histograms" in their history and
diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc
index 5bef3f5..6db3b10 100644
--- a/chrome/browser/history/url_database.cc
+++ b/chrome/browser/history/url_database.cc
@@ -10,7 +10,6 @@
#include "base/string_util.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/sqlite_utils.h"
-#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
using base::Time;
@@ -409,7 +408,7 @@ void URLDatabase::GetMostRecentKeywordSearchTerms(
bool URLDatabase::MigrateFromVersion11ToVersion12() {
URLRow about_row;
- if (GetRowForURL(GURL(chrome::kAboutBlankURL), &about_row)) {
+ if (GetRowForURL(GURL("about:blank"), &about_row)) {
about_row.set_favicon_id(0);
return UpdateURLRow(about_row.id(), about_row);
}
diff --git a/chrome/browser/renderer_host/render_view_host_unittest.cc b/chrome/browser/renderer_host/render_view_host_unittest.cc
index 22ee2ab..0ae9e46 100644
--- a/chrome/browser/renderer_host/render_view_host_unittest.cc
+++ b/chrome/browser/renderer_host/render_view_host_unittest.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/renderer_host/test_render_view_host.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
-#include "chrome/common/url_constants.h"
namespace {
@@ -16,7 +15,7 @@ class RenderViewHostTest : public RenderViewHostTestHarness {
// All about URLs reported by the renderer should get rewritten to about:blank.
// See RenderViewHost::OnMsgNavigate for a discussion.
TEST_F(RenderViewHostTest, FilterAbout) {
- rvh()->SendNavigate(1, GURL(chrome::kAboutCacheURL));
+ rvh()->SendNavigate(1, GURL("about:cache"));
ASSERT_TRUE(controller_->GetActiveEntry());
- EXPECT_EQ(GURL(chrome::kAboutBlankURL), controller_->GetActiveEntry()->url());
+ EXPECT_EQ(GURL("about:blank"), controller_->GetActiveEntry()->url());
}
diff --git a/chrome/browser/renderer_host/renderer_security_policy_unittest.cc b/chrome/browser/renderer_host/renderer_security_policy_unittest.cc
index b2b36ce..3097aac 100644
--- a/chrome/browser/renderer_host/renderer_security_policy_unittest.cc
+++ b/chrome/browser/renderer_host/renderer_security_policy_unittest.cc
@@ -88,26 +88,26 @@ TEST_F(RendererSecurityPolicyTest, AboutTest) {
EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("aBouT:BlAnK")));
EXPECT_TRUE(p->CanRequestURL(kRendererID, GURL("aBouT:blank")));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL)));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCrashURL)));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCacheURL)));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutHangURL)));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:memory")));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:crash")));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:cache")));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:hang")));
EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("aBoUt:memory")));
EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:CrASh")));
EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("abOuT:cAChe")));
- p->GrantRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL)));
+ p->GrantRequestURL(kRendererID, GURL("about:memory"));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:memory")));
- p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCrashURL));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCrashURL)));
+ p->GrantRequestURL(kRendererID, GURL("about:crash"));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:crash")));
- p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCacheURL));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCacheURL)));
+ p->GrantRequestURL(kRendererID, GURL("about:cache"));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:cache")));
- p->GrantRequestURL(kRendererID, GURL(chrome::kAboutHangURL));
- EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutHangURL)));
+ p->GrantRequestURL(kRendererID, GURL("about:hang"));
+ EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:hang")));
p->Remove(kRendererID);
}
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
index 61fa1b4..5d3a6b8 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/automation/url_request_failed_dns_job.h"
#include "chrome/browser/automation/url_request_mock_http_job.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/url_constants.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/ui/ui_test.h"
@@ -190,7 +189,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteAfterCrash) {
// Cause the renderer to crash.
expected_crashes_ = 1;
- tab->NavigateToURLAsync(GURL(chrome::kAboutCrashURL));
+ tab->NavigateToURLAsync(GURL("about:crash"));
Sleep(sleep_timeout_ms()); // Wait for browser to notice the renderer crash.
// Navigate to a new cross-site page. The browser should not wait around for
diff --git a/chrome/browser/site_instance_unittest.cc b/chrome/browser/site_instance_unittest.cc
index 85fa7d5..71fa4d9 100644
--- a/chrome/browser/site_instance_unittest.cc
+++ b/chrome/browser/site_instance_unittest.cc
@@ -241,9 +241,9 @@ TEST_F(SiteInstanceTest, IsSameWebSite) {
GURL url_foo_https = GURL("https://foo/a.html");
GURL url_foo_port = GURL("http://foo:8080/a.html");
GURL url_javascript = GURL("javascript:alert(1);");
- GURL url_crash = GURL(chrome::kAboutCrashURL);
- GURL url_hang = GURL(chrome::kAboutHangURL);
- GURL url_shorthang = GURL(chrome::kAboutShortHangURL);
+ GURL url_crash = GURL("about:crash");
+ GURL url_hang = GURL("about:hang");
+ GURL url_shorthang = GURL("about:shorthang");
// Same scheme and port -> same site.
EXPECT_TRUE(SiteInstance::IsSameWebSite(url_foo, url_foo2));
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc
index adf9568..def6c34 100644
--- a/chrome/browser/tab_contents/navigation_controller.cc
+++ b/chrome/browser/tab_contents/navigation_controller.cc
@@ -386,8 +386,7 @@ void NavigationController::RemoveEntryAtIndex(int index,
NavigateToPendingEntry(false);
} else {
// If there is nothing to show, show a default page.
- LoadURL(default_url.is_empty() ? GURL(chrome::kAboutBlankURL) :
- default_url,
+ LoadURL(default_url.is_empty() ? GURL("about:blank") : default_url,
GURL(), PageTransition::START_PAGE);
}
} else if (last_committed_entry_index_ > index) {
diff --git a/chrome/browser/tab_contents/site_instance.cc b/chrome/browser/tab_contents/site_instance.cc
index 6b6f65f..a2a051f 100644
--- a/chrome/browser/tab_contents/site_instance.cc
+++ b/chrome/browser/tab_contents/site_instance.cc
@@ -131,12 +131,12 @@ bool SiteInstance::IsSameWebSite(const GURL& url1, const GURL& url2) {
// We treat about:crash, about:hang, and about:shorthang as the same site as
// any URL, since they are used as demos for crashing/hanging a process.
- if (url1.spec() == chrome::kAboutCrashURL ||
- url2.spec() == chrome::kAboutCrashURL ||
- url1.spec() == chrome::kAboutHangURL ||
- url2.spec() == chrome::kAboutHangURL ||
- url1.spec() == chrome::kAboutShortHangURL ||
- url2.spec() == chrome::kAboutShortHangURL)
+ GURL about_crash = GURL("about:crash");
+ GURL about_hang = GURL("about:hang");
+ GURL about_shorthang = GURL("about:shorthang");
+ if (url1 == about_crash || url2 == about_crash ||
+ url1 == about_hang || url2 == about_hang ||
+ url1 == about_shorthang || url2 == about_shorthang)
return true;
// If either URL is invalid, they aren't part of the same site.
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc
index ba2dafa..ae17dbe 100644
--- a/chrome/browser/task_manager.cc
+++ b/chrome/browser/task_manager.cc
@@ -18,7 +18,6 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
-#include "chrome/common/url_constants.h"
#include "chrome/views/accelerator.h"
#include "chrome/views/background.h"
#include "chrome/views/link.h"
@@ -920,7 +919,7 @@ void TaskManagerContents::LinkActivated(views::Link* source,
DCHECK(source == about_memory_link_);
Browser* browser = BrowserList::GetLastActive();
DCHECK(browser);
- browser->OpenURL(GURL(chrome::kAboutMemoryURL), GURL(), NEW_FOREGROUND_TAB,
+ browser->OpenURL(GURL("about:memory"), GURL(), NEW_FOREGROUND_TAB,
PageTransition::LINK);
}
diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc
index 14b99e1..08dc00b 100644
--- a/chrome/browser/toolbar_model.cc
+++ b/chrome/browser/toolbar_model.cc
@@ -12,7 +12,6 @@
#include "chrome/common/l10n_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
-#include "chrome/common/url_constants.h"
#include "grit/generated_resources.h"
#include "net/base/net_util.h"
@@ -31,7 +30,8 @@ ToolbarModel::~ToolbarModel() {
// ToolbarModel Implementation.
std::wstring ToolbarModel::GetText() {
- GURL url(chrome::kAboutBlankURL);
+ static const GURL kAboutBlankURL("about:blank");
+ GURL url(kAboutBlankURL);
std::wstring languages; // Empty if we don't have a |navigation_controller|.
NavigationController* navigation_controller = GetNavigationController();