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

Unified Diff: chrome/browser/resources/omnibox/omnibox.js

Issue 149683005: about:omnibox - add current page classification to possible settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
Index: chrome/browser/resources/omnibox/omnibox.js
diff --git a/chrome/browser/resources/omnibox/omnibox.js b/chrome/browser/resources/omnibox/omnibox.js
index 242de52e75879a53153c5a96f67f731feb34348a..e0721adf47b2e7c0a21119fe6c5b0afd71c5b6bc 100644
--- a/chrome/browser/resources/omnibox/omnibox.js
+++ b/chrome/browser/resources/omnibox/omnibox.js
@@ -28,6 +28,7 @@ cr.define('omniboxDebug', function() {
$('prevent-inline-autocomplete').addEventListener(
'change', startOmniboxQuery);
$('prefer-keyword').addEventListener('change', startOmniboxQuery);
+ $('page-classification').addEventListener('change', startOmniboxQuery);
$('show-details').addEventListener('change', refresh);
$('show-incomplete-results').addEventListener('change', refresh);
$('show-all-providers').addEventListener('change', refresh);
@@ -57,17 +58,19 @@ cr.define('omniboxDebug', function() {
function startOmniboxQuery(event) {
// First, clear the results of past calls (if any).
progressiveAutocompleteResults = [];
- // Then, call chrome with a four-element list:
+ // Then, call chrome with a five-element list:
// - first element: the value in the text box
// - second element: the location of the cursor in the text box
// - third element: the value of prevent-inline-autocomplete
// - forth element: the value of prefer-keyword
+ // - fifth element: the value of page-classification
cursorPositionUsed = $('input-text').selectionEnd;
chrome.send('startOmniboxQuery', [
$('input-text').value,
cursorPositionUsed,
$('prevent-inline-autocomplete').checked,
- $('prefer-keyword').checked]);
+ $('prefer-keyword').checked,
+ parseInt($('page-classification').value)]);
// Cancel the submit action. i.e., don't submit the form. (We handle
// display the results solely with Javascript.)
event.preventDefault();

Powered by Google App Engine
This is Rietveld 408576698