summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 22:52:44 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-30 22:52:44 +0000
commit193c1d5f7eefb9a58cea348fc2fc7370ccbf89c9 (patch)
treeae61fd2c75c6d8ea372b322cc406c6cf7a474f05 /chrome/browser
parent3f28d2b87361896633174a088ccdf02720c1f8f8 (diff)
downloadchromium_src-193c1d5f7eefb9a58cea348fc2fc7370ccbf89c9.zip
chromium_src-193c1d5f7eefb9a58cea348fc2fc7370ccbf89c9.tar.gz
chromium_src-193c1d5f7eefb9a58cea348fc2fc7370ccbf89c9.tar.bz2
NTP twiddling for p13n
Review URL: http://codereview.chromium.org/19420 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc10
-rw-r--r--chrome/browser/resources/new_tab.html13
2 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 29781d3..b136bc7 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -27,6 +27,9 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/resource_bundle.h"
+#ifdef CHROME_PERSONALIZATION
+#include "chrome/personalization/personalization.h"
+#endif
#include "chromium_strings.h"
#include "generated_resources.h"
@@ -206,6 +209,10 @@ void NewTabHTMLSource::StartDataRequest(const std::string& path,
first_view_ ? L"true" : std::wstring());
first_view_ = false;
+#ifdef CHROME_PERSONALIZATION
+ localized_strings.SetString(L"p13nsrc", Personalization::GetNewTabSource());
+#endif
+
static const StringPiece new_tab_html(
ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_NEW_TAB_HTML));
@@ -816,6 +823,9 @@ void NewTabUIContents::AttachMessageHandlers() {
AddMessageHandler(new RecentlyClosedTabsHandler(this));
AddMessageHandler(new HistoryHandler(this));
AddMessageHandler(new MetricsHandler(this));
+#ifdef CHROME_PERSONALIZATION
+ Personalization::AttachNewTabHandler(this);
+#endif
NewTabHTMLSource* html_source = new NewTabHTMLSource();
diff --git a/chrome/browser/resources/new_tab.html b/chrome/browser/resources/new_tab.html
index c04c047..f158358 100644
--- a/chrome/browser/resources/new_tab.html
+++ b/chrome/browser/resources/new_tab.html
@@ -127,6 +127,16 @@ function recentlyClosedTabs(data) {
processData();
}
+function resizeP13N(new_height) {
+ var childf = document.getElementById('p13n');
+ if (new_height < 1) {
+ childf.style.display = "none";
+ return;
+ }
+ childf.height = new_height;
+ childf.style.display = "block";
+}
+
chrome.send("getMostVisited");
chrome.send("getMostSearched");
chrome.send("getRecentlyBookmarked");
@@ -436,6 +446,9 @@ document.addEventListener('DOMContentLoaded', handleDOMContentLoaded);
<img src="../../app/theme/%DISTRIBUTION%/product_logo.png"
width="145" height="52" style="padding-bottom:8px;" />
</div>
+ <iframe id="p13n" frameborder="0" width="100%" scrolling="no" height="0"
+ jsdisplay="p13nsrc" style="display:none;"
+ jsvalues="src:p13nsrc"></iframe>
<div id="searches" class="sidebar">
<div class="section-title" jscontent="searches"></div>
<form onsubmit="chrome.send('searchHistoryPage', [this.search.value]); return false;">