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

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

Issue 13375003: Fixing iframe jank in the local omnibox popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: virtual Created 7 years, 8 months 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/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/omnibox_result.html » ('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 49b0f0f1a9a52ec44a43487fe2b8f995a0d6ff6a..7e7446057e83b4780c735fc9fcf8303eeeb98cff 100644
--- a/chrome/renderer/resources/extensions/searchbox_api.js
+++ b/chrome/renderer/resources/extensions/searchbox_api.js
@@ -94,7 +94,6 @@ if (!chrome.embeddedSearch) {
native function GetAutocompleteResults();
native function GetDisplayInstantResults();
native function GetFontSize();
- native function GetSuggestionIframeURLPrefix();
native function IsKeyCaptureEnabled();
native function SetQuery();
native function SetQueryFromAutocompleteResult();
@@ -105,11 +104,10 @@ if (!chrome.embeddedSearch) {
native function FocusOmnibox();
native function StartCapturingKeyStrokes();
native function StopCapturingKeyStrokes();
- native function SetSuggestionStyle();
native function NavigateSearchBox();
native function ShowBars();
native function HideBars();
- native function ShouldUseIframes();
+ native function GetSuggestionData();
function SafeWrapSuggestion(restrictedText) {
return SafeWrap(restrictedText, 22);
@@ -127,24 +125,19 @@ if (!chrome.embeddedSearch) {
GetAutocompleteResults());
var userInput = GetQuery();
for (var i = 0, result; result = autocompleteResults[i]; ++i) {
- if (ShouldUseIframes()) {
- result.destination_url = GetSuggestionIframeURLPrefix() +
- result.rid;
- } else {
- // TODO(shishir): Fix the naming violations (chrome_search ->
- // chrome-search etc) when the server supports both names.
- var className = result.is_search ? 'chrome_search' : 'chrome_url';
- var combinedElement = '<span class=' + className + '>' +
- escapeHTML(result.contents) + '</span>';
- if (result.description) {
- combinedElement +=
- '<span class=chrome_separator> &ndash; </span>' +
- '<span class=chrome_title>' +
- escapeHTML(result.description) + '</span>';
- }
- result.combinedNode = SafeWrapSuggestion(combinedElement);
- result.destination_url = null;
+ // TODO(shishir): Fix the naming violations (chrome_search ->
+ // chrome-search etc) when the server supports both names.
+ var className = result.is_search ? 'chrome_search' : 'chrome_url';
+ var combinedElement = '<span class=' + className + '>' +
+ escapeHTML(result.contents) + '</span>';
+ if (result.description) {
+ combinedElement +=
+ '<span class=chrome_separator> &ndash; </span>' +
+ '<span class=chrome_title>' +
+ escapeHTML(result.description) + '</span>';
}
+ result.combinedNode = SafeWrapSuggestion(combinedElement);
+ result.destination_url = null;
result.contents = null;
result.description = null;
}
@@ -240,6 +233,12 @@ if (!chrome.embeddedSearch) {
this.__defineGetter__('font', GetFont);
this.__defineGetter__('fontSize', GetFontSize);
+ // This method is restricted to chrome-search://suggestion pages by
+ // checking the invoking context's origin in searchbox_extension.cc.
+ this.getSuggestionData = function(restrictedId) {
+ return GetSuggestionData(restrictedId);
+ };
+
this.setSuggestions = function(text) {
SetSuggestions(text);
};
@@ -271,9 +270,6 @@ if (!chrome.embeddedSearch) {
this.stopCapturingKeyStrokes = function() {
StopCapturingKeyStrokes();
};
- this.setSuggestionStyle = function(url_color, title_color) {
- SetSuggestionStyle(url_color, title_color);
- };
this.navigateContentWindow = function(destination, disposition) {
NavigateSearchBox(destination, disposition);
}
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/omnibox_result.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698