diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 21:06:25 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 21:06:25 +0000 |
commit | e0d481585dfab19c0b01b7518080164fa001d54c (patch) | |
tree | ac4b3d806f6917093c8d1f6319d25381934d7211 /chrome/browser | |
parent | a4c1eb2d00a9c66b4fc809916081cc727c998414 (diff) | |
download | chromium_src-e0d481585dfab19c0b01b7518080164fa001d54c.zip chromium_src-e0d481585dfab19c0b01b7518080164fa001d54c.tar.gz chromium_src-e0d481585dfab19c0b01b7518080164fa001d54c.tar.bz2 |
Replace a bunch of hardcoded URLs with constants from url_constants.h
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/193092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/autocomplete/keyword_provider_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/browser.cc | 5 | ||||
-rw-r--r-- | chrome/browser/browser_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/child_process_security_policy_unittest.cc | 32 | ||||
-rw-r--r-- | chrome/browser/download/download_uitest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/download/save_page_browsertest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/about_chrome_dialog.cc | 9 | ||||
-rw-r--r-- | chrome/browser/gtk/task_manager_gtk.cc | 5 | ||||
-rw-r--r-- | chrome/browser/gtk/view_id_util_browsertest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/history/url_database.cc | 3 | ||||
-rw-r--r-- | chrome/browser/login_prompt_uitest.cc | 3 | ||||
-rw-r--r-- | chrome/browser/renderer_host/test/site_instance_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 2 | ||||
-rw-r--r-- | chrome/browser/tab_contents/web_contents_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/toolbar_model.cc | 4 | ||||
-rw-r--r-- | chrome/browser/views/about_chrome_view.cc | 11 | ||||
-rw-r--r-- | chrome/browser/views/task_manager_view.cc | 3 |
17 files changed, 57 insertions, 53 deletions
diff --git a/chrome/browser/autocomplete/keyword_provider_unittest.cc b/chrome/browser/autocomplete/keyword_provider_unittest.cc index c7dadd5..ed93c74 100644 --- a/chrome/browser/autocomplete/keyword_provider_unittest.cc +++ b/chrome/browser/autocomplete/keyword_provider_unittest.cc @@ -116,8 +116,8 @@ TEST_F(KeywordProviderTest, Edit) { TEST_F(KeywordProviderTest, URL) { test_data<GURL> url_cases[] = { // No query input -> empty destination URL. - {L"z", 1, {GURL("")}}, - {L"z \t", 1, {GURL("")}}, + {L"z", 1, {GURL()}}, + {L"z \t", 1, {GURL()}}, // Check that tokenization only collapses whitespace between first tokens // and query input, but not rest of URL, is escaped. diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 0d8ac44..5ba9b8e 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2592,8 +2592,9 @@ TabContents* Browser::BuildRestoredTab( return new_tab; } else { // No navigations. Create a tab with about:blank. - return CreateTabContentsForURL(GURL("about:blank"), GURL(), profile_, - PageTransition::START_PAGE, false, NULL); + return CreateTabContentsForURL(GURL(chrome::kAboutBlankURL), GURL(), + profile_, PageTransition::START_PAGE, + false, NULL); } } diff --git a/chrome/browser/browser_unittest.cc b/chrome/browser/browser_unittest.cc index 702d1dce..4a3db43 100644 --- a/chrome/browser/browser_unittest.cc +++ b/chrome/browser/browser_unittest.cc @@ -3,6 +3,7 @@ // LICENSE file. #include "chrome/browser/browser.h" +#include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" #include "net/base/mock_host_resolver.h" @@ -36,7 +37,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NoTabsInPopups) { EXPECT_EQ(1, popup_browser->tab_count()); // Now try opening another tab in the popup browser. - popup_browser->AddTabWithURL(GURL("about:blank"), GURL(), + popup_browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), PageTransition::TYPED, true, -1, NULL); // The popup should still only have one tab. @@ -52,7 +53,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NoTabsInPopups) { EXPECT_EQ(1, app_browser->tab_count()); // Now try opening another tab in the app browser. - app_browser->AddTabWithURL(GURL("about:blank"), GURL(), + app_browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), PageTransition::TYPED, true, -1, NULL); // The popup should still only have one tab. @@ -68,7 +69,7 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, NoTabsInPopups) { EXPECT_EQ(1, app_popup_browser->tab_count()); // Now try opening another tab in the app popup browser. - app_popup_browser->AddTabWithURL(GURL("about:blank"), GURL(), + app_popup_browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), PageTransition::TYPED, true, -1, NULL); // The popup should still only have one tab. diff --git a/chrome/browser/child_process_security_policy_unittest.cc b/chrome/browser/child_process_security_policy_unittest.cc index 87fd0dc..2cfb489 100644 --- a/chrome/browser/child_process_security_policy_unittest.cc +++ b/chrome/browser/child_process_security_policy_unittest.cc @@ -30,12 +30,12 @@ static int kRendererID = 42; TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { ChildProcessSecurityPolicy* p = ChildProcessSecurityPolicy::GetInstance(); - EXPECT_TRUE(p->IsWebSafeScheme("http")); - EXPECT_TRUE(p->IsWebSafeScheme("https")); - EXPECT_TRUE(p->IsWebSafeScheme("ftp")); - EXPECT_TRUE(p->IsWebSafeScheme("data")); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kHttpsScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kFtpScheme)); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kDataScheme)); EXPECT_TRUE(p->IsWebSafeScheme("feed")); - EXPECT_TRUE(p->IsWebSafeScheme("chrome-extension")); + EXPECT_TRUE(p->IsWebSafeScheme(chrome::kExtensionScheme)); EXPECT_FALSE(p->IsWebSafeScheme("registered-web-safe-scheme")); p->RegisterWebSafeScheme("registered-web-safe-scheme"); @@ -45,9 +45,9 @@ TEST_F(ChildProcessSecurityPolicyTest, IsWebSafeSchemeTest) { TEST_F(ChildProcessSecurityPolicyTest, IsPseudoSchemeTest) { ChildProcessSecurityPolicy* p = ChildProcessSecurityPolicy::GetInstance(); - EXPECT_TRUE(p->IsPseudoScheme("about")); - EXPECT_TRUE(p->IsPseudoScheme("javascript")); - EXPECT_TRUE(p->IsPseudoScheme("view-source")); + EXPECT_TRUE(p->IsPseudoScheme(chrome::kAboutScheme)); + EXPECT_TRUE(p->IsPseudoScheme(chrome::kJavaScriptScheme)); + EXPECT_TRUE(p->IsPseudoScheme(chrome::kViewSourceScheme)); EXPECT_FALSE(p->IsPseudoScheme("registered-psuedo-scheme")); p->RegisterPseudoScheme("registered-psuedo-scheme"); @@ -96,17 +96,17 @@ TEST_F(ChildProcessSecurityPolicyTest, AboutTest) { EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:CrASh"))); EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("abOuT:cAChe"))); - p->GrantRequestURL(kRendererID, GURL("about:memory")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:memory"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutMemoryURL))); - p->GrantRequestURL(kRendererID, GURL("about:crash")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:crash"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCrashURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCrashURL))); - p->GrantRequestURL(kRendererID, GURL("about:cache")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:cache"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutCacheURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutCacheURL))); - p->GrantRequestURL(kRendererID, GURL("about:hang")); - EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL("about:hang"))); + p->GrantRequestURL(kRendererID, GURL(chrome::kAboutHangURL)); + EXPECT_FALSE(p->CanRequestURL(kRendererID, GURL(chrome::kAboutHangURL))); p->Remove(kRendererID); } diff --git a/chrome/browser/download/download_uitest.cc b/chrome/browser/download/download_uitest.cc index 7e6c7e7..915fc88 100644 --- a/chrome/browser/download/download_uitest.cc +++ b/chrome/browser/download/download_uitest.cc @@ -266,7 +266,7 @@ TEST_F(DownloadTest, PerWindowShelf) { EXPECT_TRUE(WaitForDownloadShelfVisible(browser.get())); // Open a second tab - browser->AppendTab(GURL("")); + browser->AppendTab(GURL()); WaitUntilTabCount(2); // Hide shelf diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc index 6962165..1f44720 100644 --- a/chrome/browser/download/save_page_browsertest.cc +++ b/chrome/browser/download/save_page_browsertest.cc @@ -11,6 +11,7 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/notification_service.h" +#include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "testing/gtest/include/gtest/gtest.h" @@ -136,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveCompleteHTML) { #endif // !defined(OS_MACOSX) IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, NoSave) { - ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); + ui_test_utils::NavigateToURL(browser(), GURL(chrome::kAboutBlankURL)); ASSERT_TRUE(browser()->command_updater()->SupportsCommand(IDC_SAVE_PAGE)); EXPECT_FALSE(browser()->command_updater()->IsCommandEnabled(IDC_SAVE_PAGE)); } diff --git a/chrome/browser/gtk/about_chrome_dialog.cc b/chrome/browser/gtk/about_chrome_dialog.cc index e0aa1ab..0a12d34 100644 --- a/chrome/browser/gtk/about_chrome_dialog.cc +++ b/chrome/browser/gtk/about_chrome_dialog.cc @@ -15,6 +15,7 @@ #include "chrome/browser/profile.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/gtk_util.h" +#include "chrome/common/url_constants.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" @@ -23,10 +24,6 @@ namespace { -// The URLs that you navigate to when clicking the links in the About dialog. -const char* const kAcknowledgements = "about:credits"; -const char* const kTOS = "about:terms"; - // Left or right margin. const int kPanelHorizMargin = 13; @@ -205,7 +202,7 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { const_cast<char*>(GetChromiumUrl())); g_signal_connect(chromium_url_appears_first ? second_link : first_link, "clicked", G_CALLBACK(OnLinkButtonClick), - const_cast<char*>(kAcknowledgements)); + const_cast<char*>(chrome::kAboutCreditsURL)); GtkWidget* license_hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(license_hbox), license_chunk1, @@ -251,7 +248,7 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { gtk_box_pack_start(GTK_BOX(tos_hbox), tos_chunk2, FALSE, FALSE, 0); g_signal_connect(tos_link, "clicked", G_CALLBACK(OnLinkButtonClick), - const_cast<char*>(kTOS)); + const_cast<char*>(chrome::kAboutTermsURL)); gtk_box_pack_start(GTK_BOX(vbox), tos_hbox, TRUE, TRUE, 0); #endif diff --git a/chrome/browser/gtk/task_manager_gtk.cc b/chrome/browser/gtk/task_manager_gtk.cc index 4563e2d..4532a03 100644 --- a/chrome/browser/gtk/task_manager_gtk.cc +++ b/chrome/browser/gtk/task_manager_gtk.cc @@ -24,6 +24,7 @@ #include "chrome/common/gtk_util.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" +#include "chrome/common/url_constants.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" @@ -494,7 +495,7 @@ void TaskManagerGtk::CreateTaskManagerTreeview() { TreeViewColumnSetVisible(treeview_, kTaskManagerPrivateMem, false); TreeViewColumnSetVisible(treeview_, kTaskManagerProcessID, false); TreeViewColumnSetVisible(treeview_, kTaskManagerGoatsTeleported, false); - + g_object_unref(process_list_); g_object_unref(process_list_sort_); } @@ -617,7 +618,7 @@ void TaskManagerGtk::ActivateFocusedTab() { void TaskManagerGtk::OnLinkActivated() { Browser* browser = BrowserList::GetLastActive(); DCHECK(browser); - browser->OpenURL(GURL("about:memory"), GURL(), NEW_FOREGROUND_TAB, + browser->OpenURL(GURL(chrome::kAboutMemoryURL), GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); // In case the browser window is minimzed, show it. If this is an application // or popup, we can only have one tab, hence we need to process this in a diff --git a/chrome/browser/gtk/view_id_util_browsertest.cc b/chrome/browser/gtk/view_id_util_browsertest.cc index 6c3d784..950888e 100644 --- a/chrome/browser/gtk/view_id_util_browsertest.cc +++ b/chrome/browser/gtk/view_id_util_browsertest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/gtk/view_id_util.h" +#include "chrome/common/url_constants.h" #include "chrome/test/in_process_browser_test.h" class ViewIDTest : public InProcessBrowserTest { @@ -35,7 +36,7 @@ IN_PROC_BROWSER_TEST_F(ViewIDTest, Delegate) { CheckViewID(VIEW_ID_TAB_0, true); CheckViewID(VIEW_ID_TAB_1, false); - browser()->OpenURL(GURL("about:blank"), GURL(""), + browser()->OpenURL(GURL(chrome::kAboutBlankURL), GURL(), NEW_BACKGROUND_TAB, PageTransition::TYPED); CheckViewID(VIEW_ID_TAB_0, true); diff --git a/chrome/browser/history/url_database.cc b/chrome/browser/history/url_database.cc index a72ce2c..b15af5b 100644 --- a/chrome/browser/history/url_database.cc +++ b/chrome/browser/history/url_database.cc @@ -10,6 +10,7 @@ #include "app/l10n_util.h" #include "base/string_util.h" #include "chrome/common/sqlite_utils.h" +#include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" using base::Time; @@ -408,7 +409,7 @@ void URLDatabase::GetMostRecentKeywordSearchTerms( bool URLDatabase::MigrateFromVersion11ToVersion12() { URLRow about_row; - if (GetRowForURL(GURL("about:blank"), &about_row)) { + if (GetRowForURL(GURL(chrome::kAboutBlankURL), &about_row)) { about_row.set_favicon_id(0); return UpdateURLRow(about_row.id(), about_row); } diff --git a/chrome/browser/login_prompt_uitest.cc b/chrome/browser/login_prompt_uitest.cc index 9751533..6c7ec9c 100644 --- a/chrome/browser/login_prompt_uitest.cc +++ b/chrome/browser/login_prompt_uitest.cc @@ -6,6 +6,7 @@ #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/url_constants.h" #include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/ui/ui_test.h" @@ -113,7 +114,7 @@ TEST_F(LoginPromptTest, TestTwoAuths) { scoped_refptr<TabProxy> basic_tab(GetActiveTabProxy()); NavigateTab(basic_tab.get(), server->TestServerPageW(L"auth-basic")); - AppendTab(GURL("about:blank")); + AppendTab(GURL(chrome::kAboutBlankURL)); scoped_refptr<TabProxy> digest_tab(GetActiveTabProxy()); NavigateTab(digest_tab.get(), server->TestServerPageW(L"auth-digest")); diff --git a/chrome/browser/renderer_host/test/site_instance_unittest.cc b/chrome/browser/renderer_host/test/site_instance_unittest.cc index 6953f36..0320152 100644 --- a/chrome/browser/renderer_host/test/site_instance_unittest.cc +++ b/chrome/browser/renderer_host/test/site_instance_unittest.cc @@ -10,6 +10,7 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/url_constants.h" #include "chrome/common/render_messages.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" @@ -246,9 +247,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("about:crash"); - GURL url_hang = GURL("about:hang"); - GURL url_shorthang = GURL("about:shorthang"); + GURL url_crash = GURL(chrome::kAboutCrashURL); + GURL url_hang = GURL(chrome::kAboutHangURL); + GURL url_shorthang = GURL(chrome::kAboutShorthangURL); // Same scheme and port -> same site. EXPECT_TRUE(SiteInstance::IsSameWebSite(url_foo, url_foo2)); diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 0e8471d..991b0e2 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -878,7 +878,7 @@ bool TabContents::FocusLocationBarByDefault() { if (dom_ui) return dom_ui->focus_location_bar_by_default(); NavigationEntry* entry = controller_.GetActiveEntry(); - if (entry && entry->url() == GURL("about:blank")) + if (entry && entry->url() == GURL(chrome::kAboutBlankURL)) return true; return false; } diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index b5a8048..987eb9f 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,6 +14,7 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_service.h" #include "chrome/common/render_messages.h" +#include "chrome/common/url_constants.h" #include "chrome/test/testing_profile.h" #include "ipc/ipc_channel.h" #include "testing/gtest/include/gtest/gtest.h" @@ -206,7 +207,7 @@ class TabContentsTest : public RenderViewHostTestHarness { // Test to make sure that title updates get stripped of whitespace. TEST_F(TabContentsTest, UpdateTitle) { ViewHostMsg_FrameNavigate_Params params; - InitNavigateParams(¶ms, 0, GURL("about:blank")); + InitNavigateParams(¶ms, 0, GURL(chrome::kAboutBlankURL)); NavigationController::LoadCommittedDetails details; controller().RendererDidNavigate(params, &details); @@ -555,7 +556,7 @@ TEST_F(TabContentsTest, NavigationEntryContentStateNewWindow) { // When opening a new window, it is navigated to about:blank internally. // Currently, this results in two DidNavigate events. - const GURL url("about:blank"); + const GURL url(chrome::kAboutBlankURL); ViewHostMsg_FrameNavigate_Params params1; InitNavigateParams(¶ms1, 1, url); contents()->TestDidNavigate(orig_rvh, params1); diff --git a/chrome/browser/toolbar_model.cc b/chrome/browser/toolbar_model.cc index ec7ee2e..1169c42 100644 --- a/chrome/browser/toolbar_model.cc +++ b/chrome/browser/toolbar_model.cc @@ -13,6 +13,7 @@ #include "chrome/browser/tab_contents/tab_contents.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" @@ -24,8 +25,7 @@ ToolbarModel::~ToolbarModel() { // ToolbarModel Implementation. std::wstring ToolbarModel::GetText() { - static const GURL kAboutBlankURL("about:blank"); - GURL url(kAboutBlankURL); + GURL url(chrome::kAboutBlankURL); std::wstring languages; // Empty if we don't have a |navigation_controller|. NavigationController* navigation_controller = GetNavigationController(); diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index 923e9bb..6b2ba40 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -18,6 +18,7 @@ #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/views/restart_message_box.h" #include "chrome/common/chrome_constants.h" +#include "chrome/common/url_constants.h" #include "chrome/installer/util/install_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -37,10 +38,6 @@ namespace { // the version field doesn't overlap it. const int kVersionFieldWidth = 195; -// The URLs that you navigate to when clicking the links in the About dialog. -const wchar_t* const kAcknowledgements = L"about:credits"; -const wchar_t* const kTOS = L"about:terms"; - // These are used as placeholder text around the links in the text in the about // dialog. const wchar_t* kBeginLink = L"BEGIN_LINK"; @@ -65,7 +62,7 @@ std::wstring StringSubRange(const std::wstring& text, size_t start, namespace browser { -// Declared in browser_dialogs.h so that others don't need to depend on our .h. +// Declared in browser_dialogs.h so that others don't need to depend on our .h. void ShowAboutChromeView(views::Widget* parent, Profile* profile) { views::Window::CreateChromeWindow(parent->GetNativeView(), gfx::Rect(), @@ -699,11 +696,11 @@ void AboutChromeView::LinkActivated(views::Link* source, int event_flags) { GURL url; if (source == terms_of_service_url_) - url = GURL(kTOS); + url = GURL(chrome::kAboutTermsURL); else if (source == chromium_url_) url = GURL(l10n_util::GetString(IDS_CHROMIUM_PROJECT_URL)); else if (source == open_source_url_) - url = GURL(kAcknowledgements); + url = GURL(chrome::kAboutCreditsURL); else NOTREACHED() << "Unknown link source"; diff --git a/chrome/browser/views/task_manager_view.cc b/chrome/browser/views/task_manager_view.cc index b305a96..2a26896 100644 --- a/chrome/browser/views/task_manager_view.cc +++ b/chrome/browser/views/task_manager_view.cc @@ -14,6 +14,7 @@ #include "chrome/browser/views/browser_dialogs.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" +#include "chrome/common/url_constants.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -519,7 +520,7 @@ void TaskManagerView::LinkActivated(views::Link* source, int event_flags) { DCHECK(source == about_memory_link_); Browser* browser = BrowserList::GetLastActive(); DCHECK(browser); - browser->OpenURL(GURL("about:memory"), GURL(), NEW_FOREGROUND_TAB, + browser->OpenURL(GURL(chrome::kAboutMemoryURL), GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); // In case the browser window is minimzed, show it. If this is an application // or popup, we can only have one tab, hence we need to process this in a |