Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9628)

Unified Diff: chrome/renderer/resources/extensions/searchbox_api.js

Issue 11413018: alternate ntp: implement searchbox api for instant overlay to adopt themes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed sreeram's comments, fixed to not set theme fields if no theme Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/render_messages.h ('k') | chrome/renderer/searchbox/searchbox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/searchbox_api.js
diff --git a/chrome/renderer/resources/extensions/searchbox_api.js b/chrome/renderer/resources/extensions/searchbox_api.js
index fd6cd6200839b9f3a5c51b842b5a423a48b0b249..66e9751b8c188a0aba757c67e6dc6b62ee936b22 100644
--- a/chrome/renderer/resources/extensions/searchbox_api.js
+++ b/chrome/renderer/resources/extensions/searchbox_api.js
@@ -30,6 +30,8 @@ if (!chrome.searchBox) {
native function GetHeight();
native function GetAutocompleteResults();
native function GetContext();
+ native function GetThemeBackgroundInfo();
+ native function GetThemeAreaHeight();
native function NavigateContentWindow();
native function SetSuggestions();
native function SetQuerySuggestion();
@@ -57,7 +59,7 @@ if (!chrome.searchBox) {
// Wraps the AutocompleteResult query and URL into ShadowDOM nodes so that
// the JS cannot access them and deletes the raw values.
function GetAutocompleteResultsWrapper() {
- var autocompleteResults = DedupeAutcompleteResults(
+ var autocompleteResults = DedupeAutocompleteResults(
GetAutocompleteResults());
var userInput = GetQuery();
for (var i = 0, result; result = autocompleteResults[i]; ++i) {
@@ -96,7 +98,7 @@ if (!chrome.searchBox) {
// Removes duplicates from AutocompleteResults.
// TODO(dcblack): Do this in C++ instead of JS.
- function DedupeAutcompleteResults(autocompleteResults) {
+ function DedupeAutocompleteResults(autocompleteResults) {
var urlToResultMap = {};
for (var i = 0, result; result = autocompleteResults[i]; ++i) {
var url = CanonicalizeUrl(result.destination_url);
@@ -175,6 +177,8 @@ if (!chrome.searchBox) {
this.__defineGetter__('height', GetHeight);
this.__defineGetter__('nativeSuggestions', GetAutocompleteResultsWrapper);
this.__defineGetter__('context', GetContext);
+ this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo);
+ this.__defineGetter__('themeAreaHeight', GetThemeAreaHeight);
this.setSuggestions = function(text) {
SetSuggestions(text);
};
« no previous file with comments | « chrome/common/render_messages.h ('k') | chrome/renderer/searchbox/searchbox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698