diff options
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 3 | ||||
-rw-r--r-- | chrome/browser/dom_ui/ntp_resource_cache.cc | 1 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.css | 4 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.html | 6 | ||||
-rw-r--r-- | chrome/browser/views/app_launcher.cc | 2 | ||||
-rw-r--r-- | chrome/common/url_constants.cc | 1 | ||||
-rw-r--r-- | chrome/common/url_constants.h | 1 |
7 files changed, 15 insertions, 3 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 749b8e9..8ef66a3 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -680,7 +680,8 @@ void NewTabUI::NewTabHTMLSource::StartDataRequest(const std::string& path, bool is_off_the_record, int request_id) { DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); - if (!path.empty()) { + + if (!path.empty() && path[0] != '#') { // A path under new-tab was requested; it's likely a bad relative // URL from the new tab page, but in any case it's an error. NOTREACHED(); diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc index 5f92ca2..17d1ee4 100644 --- a/chrome/browser/dom_ui/ntp_resource_cache.cc +++ b/chrome/browser/dom_ui/ntp_resource_cache.cc @@ -378,7 +378,6 @@ void NTPResourceCache::CreateNewTabHTML() { NOTREACHED(); full_html.assign(new_tab_html.data(), new_tab_html.size()); } - jstemplate_builder::AppendI18nTemplateProcessHtml(&full_html); new_tab_html_ = new RefCountedBytes; new_tab_html_->data.resize(full_html.size()); diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index 56da1fd..43099a13 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -16,6 +16,10 @@ body { min-height: 100%; } +html[hash=app-launcher] #container { + min-height: 0; +} + #promo-spacer { height: 50px; } diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index e7e4d3e..a10b238 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -96,6 +96,9 @@ function updateSimpleSection(id, section) { document.getElementById(id).className += ' hidden'; } +// Reflect the hash as an attribute so we can use CSS attribute selectors on it. +document.documentElement.setAttribute('hash', location.hash.slice(1)); + </script> </head> <body class="loading" @@ -199,6 +202,9 @@ function updateSimpleSection(id, section) { </body> <script src="shared/js/i18n_template.js"></script> +<script> +i18nTemplate.process(document, templateData); +</script> <script src="shared/js/local_strings.js"></script> <script src="shared/js/class_list.js"></script> <script src="shared/js/parse_html_subset.js"></script> diff --git a/chrome/browser/views/app_launcher.cc b/chrome/browser/views/app_launcher.cc index 9f05f48..7bd9ddb 100644 --- a/chrome/browser/views/app_launcher.cc +++ b/chrome/browser/views/app_launcher.cc @@ -57,7 +57,7 @@ static GURL GetMenuURL() { CommandLine::ForCurrentProcess()->GetSwitchValue(kURLSwitch); if (!url_string.empty()) return GURL(WideToUTF8(url_string)); - return GURL(chrome::kChromeUINewTabURL); + return GURL(chrome::kChromeUIAppLauncherURL); } } // namespace diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index 8b3e45b..748ae19 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -53,6 +53,7 @@ const char kAboutTermsURL[] = "about:terms"; // to be used for testing. const char kAboutBrowserCrash[] = "about:inducebrowsercrashforrealz"; +const char kChromeUIAppLauncherURL[] = "chrome://newtab/#app-launcher"; const char kChromeUIBookmarksURL[] = "chrome://bookmarks/"; const char kChromeUIDevToolsURL[] = "chrome://devtools/"; const char kChromeUIDownloadsURL[] = "chrome://downloads/"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index 741a372..230cc67 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -49,6 +49,7 @@ extern const char kAboutTermsURL[]; // chrome: URLs (including schemes). Should be kept in sync with the // components below. +extern const char kChromeUIAppLauncherURL[]; extern const char kChromeUIBookmarksURL[]; extern const char kChromeUIDevToolsURL[]; extern const char kChromeUIDownloadsURL[]; |