summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc10
-rw-r--r--chrome/browser/resources/new_tab.html13
-rw-r--r--chrome/common/notification_types.h1
3 files changed, 24 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;">
diff --git a/chrome/common/notification_types.h b/chrome/common/notification_types.h
index c07a3aa..788ba17 100644
--- a/chrome/common/notification_types.h
+++ b/chrome/common/notification_types.h
@@ -499,6 +499,7 @@ enum NotificationType {
// Personalization -----------------------------------------------------------
NOTIFY_PERSONALIZATION,
+ NOTIFY_PERSONALIZATION_CREATED,
// User Scripts --------------------------------------------------------------