summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 20:17:00 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 20:17:00 +0000
commit0ed164e1bbe8bde1b5be616c10ef46388ea78079 (patch)
treef3245ca128c4240c37c47a7501faa985951e634e /chrome
parent0654b7ba355aab9435a54cf9b5a7397ffc308b45 (diff)
downloadchromium_src-0ed164e1bbe8bde1b5be616c10ef46388ea78079.zip
chromium_src-0ed164e1bbe8bde1b5be616c10ef46388ea78079.tar.gz
chromium_src-0ed164e1bbe8bde1b5be616c10ef46388ea78079.tar.bz2
Remove the TAB_CONTENTS_NEW_TAB_UI tab contents type. This was not actually used
now, so everytime this appears was dead code. Review URL: http://codereview.chromium.org/39200 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc13
-rw-r--r--chrome/browser/tab_contents/navigation_controller.cc1
-rw-r--r--chrome/browser/tab_contents/tab_contents_factory.cc1
-rw-r--r--chrome/browser/tab_contents/tab_contents_type.h1
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc5
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc2
-rw-r--r--chrome/common/url_constants.cc3
-rw-r--r--chrome/common/url_constants.h5
8 files changed, 17 insertions, 14 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 34b3ba6..79ce95a 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -27,6 +27,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
+#include "chrome/common/url_constants.h"
#ifdef CHROME_PERSONALIZATION
#include "chrome/personalization/personalization.h"
#endif
@@ -35,9 +36,6 @@
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
-// NewTabUI is accessible from chrome-ui://newtab.
-static const char kNewTabHost[] = "newtab";
-
// The number of most visited pages we show.
const int kMostVisitedPages = 9;
@@ -175,7 +173,7 @@ void SetURLTitleAndDirection(DictionaryValue* dictionary,
// NewTabHTMLSource
NewTabHTMLSource::NewTabHTMLSource()
- : DataSource(kNewTabHost, MessageLoop::current()) {
+ : DataSource(chrome::kNewTabHost, MessageLoop::current()) {
}
void NewTabHTMLSource::StartDataRequest(const std::string& path,
@@ -254,7 +252,7 @@ void NewTabHTMLSource::StartDataRequest(const std::string& path,
// IncognitoTabHTMLSource
IncognitoTabHTMLSource::IncognitoTabHTMLSource()
- : DataSource(kNewTabHost, MessageLoop::current()) {
+ : DataSource(chrome::kNewTabHost, MessageLoop::current()) {
}
void IncognitoTabHTMLSource::StartDataRequest(const std::string& path,
@@ -844,10 +842,7 @@ void NewTabUI::Init() {
// static
GURL NewTabUI::GetBaseURL() {
- std::string url = DOMUIContents::GetScheme();
- url += "://";
- url += kNewTabHost;
- return GURL(url);
+ return GURL(chrome::kChromeUINewTabURL);
}
void NewTabUI::SetInitialFocus() {
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc
index 850a865..a35f454 100644
--- a/chrome/browser/tab_contents/navigation_controller.cc
+++ b/chrome/browser/tab_contents/navigation_controller.cc
@@ -54,7 +54,6 @@ void NotifyPrunedEntries(NavigationController* nav_controller,
void SetContentStateIfEmpty(NavigationEntry* entry) {
if (entry->content_state().empty() &&
(entry->tab_type() == TAB_CONTENTS_WEB ||
- entry->tab_type() == TAB_CONTENTS_NEW_TAB_UI ||
entry->tab_type() == TAB_CONTENTS_DOM_UI ||
entry->tab_type() == TAB_CONTENTS_HTML_DIALOG ||
entry->IsViewSourceMode())) {
diff --git a/chrome/browser/tab_contents/tab_contents_factory.cc b/chrome/browser/tab_contents/tab_contents_factory.cc
index 01db2d1..fa8787e 100644
--- a/chrome/browser/tab_contents/tab_contents_factory.cc
+++ b/chrome/browser/tab_contents/tab_contents_factory.cc
@@ -55,7 +55,6 @@ TabContents* TabContents::CreateWithType(TabContentsType type,
break;
#endif // defined(OS_WIN)
case TAB_CONTENTS_DEBUGGER:
- case TAB_CONTENTS_NEW_TAB_UI:
case TAB_CONTENTS_DOM_UI:
contents = new DOMUIContents(profile, instance, NULL);
break;
diff --git a/chrome/browser/tab_contents/tab_contents_type.h b/chrome/browser/tab_contents/tab_contents_type.h
index 517e5a9..28ee69f 100644
--- a/chrome/browser/tab_contents/tab_contents_type.h
+++ b/chrome/browser/tab_contents/tab_contents_type.h
@@ -13,7 +13,6 @@ enum TabContentsType {
TAB_CONTENTS_UNKNOWN_TYPE = 0,
TAB_CONTENTS_WEB,
TAB_CONTENTS_CHROME_VIEW_CONTENTS,
- TAB_CONTENTS_NEW_TAB_UI,
TAB_CONTENTS_HTML_DIALOG,
TAB_CONTENTS_DEBUGGER,
TAB_CONTENTS_DOM_UI,
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 46d56fb..6a67942 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -13,12 +13,14 @@
#include "chrome/common/temp_scaffolding_stubs.h"
#endif
+#include "base/string_util.h"
#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/tabs/tab_strip_model_order_controller.h"
#include "chrome/browser/tab_contents/navigation_controller.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/stl_util-inl.h"
+#include "chrome/common/url_constants.h"
namespace {
@@ -532,7 +534,8 @@ void TabStripModel::Observe(NotificationType type,
// TabStripModel, private:
bool TabStripModel::IsNewTabAtEndOfTabStrip(TabContents* contents) const {
- return contents->type() == TAB_CONTENTS_NEW_TAB_UI &&
+ return LowerCaseEqualsASCII(contents->GetURL().spec(),
+ chrome::kChromeUINewTabURL) &&
contents == GetContentsAt(count() - 1) &&
contents->controller()->GetEntryCount() == 1;
}
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc
index 48a16b4..323fd25 100644
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc
@@ -142,7 +142,7 @@ class TabStripModelTest : public testing::Test {
}
TabContents* CreateNewTabTabContents() {
TabStripModelTestTabContents* contents =
- new TabStripModelTestTabContents(TAB_CONTENTS_NEW_TAB_UI);
+ new TabStripModelTestTabContents(TAB_CONTENTS_WEB);
contents->SetupController(profile_);
return contents;
}
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index f5db717..62193b21 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -29,5 +29,8 @@ const char kAboutMemoryURL[] = "about:memory";
const char kChromeUIIPCURL[] = "chrome-ui://about/ipc";
const char kChromeUINetworkURL[] = "chrome-ui://about/network";
+const char kChromeUINewTabURL[] = "chrome-ui://newtab";
+
+const char kNewTabHost[] = "newtab";
} // namespace chrome
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index 6761663..63989e9 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -33,8 +33,13 @@ extern const char kAboutBlankURL[];
extern const char kAboutCacheURL[];
extern const char kAboutMemoryURL[];
+// chrome-ui: URLs (including schemes).
extern const char kChromeUIIPCURL[];
extern const char kChromeUINetworkURL[];
+extern const char kChromeUINewTabURL[];
+
+// chrome-ui components of URLs.
+extern const char kNewTabHost[];
} // namespace chrome