summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 01:13:10 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 01:13:10 +0000
commit1b6f6ffd39c1620d7ffd802e82a4b87653f5a463 (patch)
tree3e325ca60b285dec6a748c9ad3ca1c47eab285ee
parentb95b915d8a831681ee4f7219152f2c00e5cd93cd (diff)
downloadchromium_src-1b6f6ffd39c1620d7ffd802e82a4b87653f5a463.zip
chromium_src-1b6f6ffd39c1620d7ffd802e82a4b87653f5a463.tar.gz
chromium_src-1b6f6ffd39c1620d7ffd802e82a4b87653f5a463.tar.bz2
Add autocomplete provider for "about:" URLs.
This is a reworked version of r74451 that makes the following changes: * Removed function to convert an about: string to a URL. We don't need this in the autocomplete side because the "about:" URLs will be correctly handled when the user hits enter; and removing it means we don't need to ensure that the data provider is initialized, because that will also be done automatically. * Clean up the about:about HTML construction to be shorter and produce slightly more readable source code * Remove about:vaporware (cleared with thakis, who added it) (Obviously, the last two changes are "while I'm here, ..." cleanups.) BUG=6870 TEST=Typing "about:s" into the omnibox should result in a couple of "about:s..." URL entries in the dropdown even if you've never visited them. Review URL: http://codereview.chromium.org/6474019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75691 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc2
-rw-r--r--chrome/browser/autocomplete/autocomplete.h3
-rw-r--r--chrome/browser/autocomplete/builtin_provider.cc51
-rw-r--r--chrome/browser/autocomplete/builtin_provider.h38
-rw-r--r--chrome/browser/browser_about_handler.cc72
-rw-r--r--chrome/browser/browser_about_handler.h4
-rw-r--r--chrome/browser/instant/instant_browsertest.cc56
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/common/url_constants.cc1
-rw-r--r--chrome/common/url_constants.h1
-rw-r--r--chrome/test/data/instant/nosearch.html38
-rw-r--r--chrome/test/data/instant/search.html2
12 files changed, 166 insertions, 104 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 57ddada..daad189 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
+#include "chrome/browser/autocomplete/builtin_provider.h"
#include "chrome/browser/autocomplete/history_contents_provider.h"
#include "chrome/browser/autocomplete/history_quick_provider.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
@@ -796,6 +797,7 @@ AutocompleteController::AutocompleteController(
providers_.push_back(new HistoryURLProvider(this, profile));
providers_.push_back(new KeywordProvider(this, profile));
providers_.push_back(new HistoryContentsProvider(this, profile));
+ providers_.push_back(new BuiltinProvider(this, profile));
for (ACProviders::iterator i(providers_.begin()); i != providers_.end(); ++i)
(*i)->AddRef();
}
diff --git a/chrome/browser/autocomplete/autocomplete.h b/chrome/browser/autocomplete/autocomplete.h
index 9a182b1..395d469 100644
--- a/chrome/browser/autocomplete/autocomplete.h
+++ b/chrome/browser/autocomplete/autocomplete.h
@@ -54,6 +54,7 @@
// Search Primary Provider (navigational suggestion) | 800++
// HistoryContents (any match in title of nonstarred page) | 700++
// Search Primary Provider (suggestion) | 600++
+// Built-in | 575++
// HistoryContents (any match in body of starred page) | 550++
// HistoryContents (any match in body of nonstarred page) | 500++
// Keyword (inexact match) | 450
@@ -76,6 +77,7 @@
// Search Primary Provider (navigational suggestion) | 800++
// HistoryContents (any match in title of nonstarred page) | 700++
// Search Primary Provider (suggestion) | 600++
+// Built-in | 575++
// HistoryContents (any match in body of starred page) | 550++
// HistoryContents (any match in body of nonstarred page) | 500++
// Keyword (inexact match) | 450
@@ -95,6 +97,7 @@
// Search Primary Provider (navigational suggestion) | 800++
// Search Primary Provider (past query in history) | 750--
// Keyword (inexact match) | 700
+// Built-in | 575++
// Search Primary Provider (suggestion) | 300++
// Search Secondary Provider (what you typed) | 250
// Search Secondary Provider (past query in history) | 200--
diff --git a/chrome/browser/autocomplete/builtin_provider.cc b/chrome/browser/autocomplete/builtin_provider.cc
new file mode 100644
index 0000000..355158d
--- /dev/null
+++ b/chrome/browser/autocomplete/builtin_provider.cc
@@ -0,0 +1,51 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/autocomplete/builtin_provider.h"
+
+#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/browser/autocomplete/autocomplete_match.h"
+#include "chrome/browser/browser_about_handler.h"
+#include "chrome/browser/net/url_fixer_upper.h"
+
+const int BuiltinProvider::kRelevance = 575;
+
+BuiltinProvider::BuiltinProvider(ACProviderListener* listener,
+ Profile* profile)
+ : AutocompleteProvider(listener, profile, "Builtin") {
+ std::vector<std::string> builtins(AboutPaths());
+ for (std::vector<std::string>::iterator i(builtins.begin());
+ i != builtins.end(); ++i)
+ builtins_.push_back(ASCIIToUTF16("about:") + ASCIIToUTF16(*i));
+}
+
+void BuiltinProvider::Start(const AutocompleteInput& input,
+ bool minimal_changes) {
+ matches_.clear();
+ if ((input.type() == AutocompleteInput::INVALID) ||
+ (input.type() == AutocompleteInput::FORCED_QUERY) ||
+ (input.type() == AutocompleteInput::QUERY))
+ return;
+ for (Builtins::const_iterator i(builtins_.begin());
+ (i != builtins_.end()) && (matches_.size() < kMaxMatches); ++i) {
+ if (StartsWith(*i, input.text(), false)) {
+ AutocompleteMatch match(this, kRelevance, false,
+ AutocompleteMatch::NAVSUGGEST);
+ match.fill_into_edit = *i;
+ match.destination_url = GURL(*i);
+ match.contents = match.fill_into_edit;
+ match.contents_class.push_back(ACMatchClassification(0,
+ ACMatchClassification::MATCH | ACMatchClassification::URL));
+ if (match.contents.length() > input.text().length()) {
+ match.contents_class.push_back(
+ ACMatchClassification(input.text().length(),
+ ACMatchClassification::URL));
+ }
+ matches_.push_back(match);
+ }
+ }
+ for (size_t i = 0; i < matches_.size(); ++i)
+ matches_[i].relevance = kRelevance + matches_.size() - (i + 1);
+}
diff --git a/chrome/browser/autocomplete/builtin_provider.h b/chrome/browser/autocomplete/builtin_provider.h
new file mode 100644
index 0000000..64122b1
--- /dev/null
+++ b/chrome/browser/autocomplete/builtin_provider.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// This file contains the autocomplete provider for built-in URLs,
+// such as about:settings.
+//
+// For more information on the autocomplete system in general, including how
+// the autocomplete controller and autocomplete providers work, see
+// chrome/browser/autocomplete.h.
+
+#ifndef CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_
+#define CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_
+#pragma once
+
+#include <vector>
+
+#include "base/string16.h"
+#include "chrome/browser/autocomplete/autocomplete.h"
+
+class BuiltinProvider : public AutocompleteProvider {
+ public:
+ BuiltinProvider(ACProviderListener* listener, Profile* profile);
+
+ // AutocompleteProvider:
+ virtual void Start(const AutocompleteInput& input, bool minimal_changes);
+
+ private:
+ static const int kRelevance;
+
+ typedef std::vector<string16> Builtins;
+
+ Builtins builtins_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(BuiltinProvider);
+};
+
+#endif // CHROME_BROWSER_AUTOCOMPLETE_BUILTIN_PROVIDER_H_
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index f26b824..43b30d7 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -136,6 +136,7 @@ const char kOSCreditsPath[] = "os-credits";
// Add path here to be included in about:about
const char *kAllAboutPaths[] = {
+ kAboutPath,
kAppCacheInternalsPath,
kBlobInternalsPath,
kCachePath,
@@ -261,43 +262,35 @@ class ChromeOSAboutVersionHandler {
// Individual about handlers ---------------------------------------------------
std::string AboutAbout() {
- std::string html;
- html.append("<html><head><title>About Pages</title></head><body>\n");
- html.append("<h2>List of About pages</h2><ul>\n");
- for (size_t i = 0; i < arraysize(kAllAboutPaths); i++) {
- if (kAllAboutPaths[i] == kAppCacheInternalsPath ||
- kAllAboutPaths[i] == kBlobInternalsPath ||
- kAllAboutPaths[i] == kCachePath ||
-#if defined(OS_WIN)
- kAllAboutPaths[i] == kConflictsPath ||
-#endif
- kAllAboutPaths[i] == kFlagsPath ||
- kAllAboutPaths[i] == kGpuPath ||
- kAllAboutPaths[i] == kNetInternalsPath ||
- kAllAboutPaths[i] == kPluginsPath) {
- html.append("<li><a href='chrome://");
- } else {
- html.append("<li><a href='chrome://about/");
+ std::string html("<html><head><title>About Pages</title></head>\n"
+ "<body><h2>List of About pages</h2>\n<ul>");
+ std::vector<std::string> paths(AboutPaths());
+ for (std::vector<std::string>::const_iterator i = paths.begin();
+ i != paths.end(); ++i) {
+ html += "<li><a href='chrome://";
+ if ((*i != kAppCacheInternalsPath) &&
+ (*i != kBlobInternalsPath) &&
+ (*i != kCachePath) &&
+ #if defined(OS_WIN)
+ (*i != kConflictsPath) &&
+ #endif
+ (*i != kFlagsPath) &&
+ (*i != kGpuPath) &&
+ (*i != kNetInternalsPath) &&
+ (*i != kPluginsPath)) {
+ html += "about/";
}
- html.append(kAllAboutPaths[i]);
- html.append("/'>about:");
- html.append(kAllAboutPaths[i]);
- html.append("</a>\n");
+ html += *i + "/'>about:" + *i + "</a></li>\n";
}
const char *debug[] = { "crash", "kill", "hang", "shorthang",
"gpucrash", "gpuhang" };
- html.append("</ul><h2>For Debug</h2>");
- html.append("</ul><p>The following pages are for debugging purposes only. "
- "Because they crash or hang the renderer, they're not linked "
- "directly; you can type them into the address bar if you need "
- "them.</p><ul>");
- for (size_t i = 0; i < arraysize(debug); i++) {
- html.append("<li>");
- html.append("about:");
- html.append(debug[i]);
- html.append("\n");
- }
- html.append("</ul></body></html>");
+ html += "</ul>\n<h2>For Debug</h2>\n"
+ "<p>The following pages are for debugging purposes only. Because they "
+ "crash or hang the renderer, they're not linked directly; you can type "
+ "them into the address bar if you need them.</p>\n<ul>";
+ for (size_t i = 0; i < arraysize(debug); i++)
+ html += "<li>about:" + std::string(debug[i]) + "</li>\n";
+ html += "</ul>\n</body></html>";
return html;
}
@@ -1030,9 +1023,8 @@ bool WillHandleBrowserAboutURL(GURL* url, Profile* profile) {
}
#endif
- // Rewrite about:flags and about:vaporware to chrome://flags/.
- if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutFlagsURL) ||
- LowerCaseEqualsASCII(url->spec(), chrome::kAboutVaporwareURL)) {
+ // Rewrite about:flags to chrome://flags/.
+ if (LowerCaseEqualsASCII(url->spec(), chrome::kAboutFlagsURL)) {
*url = GURL(chrome::kChromeUIFlagsURL);
return true;
}
@@ -1136,3 +1128,11 @@ bool HandleNonNavigationAboutURL(const GURL& url) {
return false;
}
+
+std::vector<std::string> AboutPaths() {
+ std::vector<std::string> paths;
+ paths.reserve(arraysize(kAllAboutPaths));
+ for (size_t i = 0; i < arraysize(kAllAboutPaths); i++)
+ paths.push_back(kAllAboutPaths[i]);
+ return paths;
+}
diff --git a/chrome/browser/browser_about_handler.h b/chrome/browser/browser_about_handler.h
index 90d140b..b894ceb 100644
--- a/chrome/browser/browser_about_handler.h
+++ b/chrome/browser/browser_about_handler.h
@@ -10,6 +10,7 @@
#include <map>
#include <string>
+#include <vector>
#include "base/process.h"
#include "base/string_util.h"
@@ -35,6 +36,9 @@ void InitializeAboutDataSource(Profile* profile);
// case, normal tab navigation should be skipped.
bool HandleNonNavigationAboutURL(const GURL& url);
+// Gets the paths that are shown in about:about.
+std::vector<std::string> AboutPaths();
+
#if defined(USE_TCMALLOC)
// A map of header strings (e.g. "Browser", "Renderer PID 123")
// to the tcmalloc output collected for each process.
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index e9424b4..2087bae 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -82,7 +82,9 @@ class InstantTest : public InProcessBrowserTest {
// Type a character to get instant to trigger.
void SetupLocationBar() {
FindLocationBar();
- location_bar_->location_entry()->SetUserText(ASCIIToUTF16("a"));
+ // "a" triggers the "about:" provider. "b" begins the "bing.com" keyword.
+ // "c" might someday trigger a "chrome:" provider.
+ location_bar_->location_entry()->SetUserText(ASCIIToUTF16("d"));
}
// Waits for preview to be shown.
@@ -108,7 +110,7 @@ class InstantTest : public InProcessBrowserTest {
// When the page loads, the initial searchBox values are set and only a
// resize will have been sent.
- ASSERT_EQ("true 0 0 0 1 a false a false 1 1",
+ ASSERT_EQ("true 0 0 0 1 d false d false 1 1",
GetSearchStateAsString(preview_));
}
@@ -290,9 +292,9 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnChangeEvent) {
ASSERT_NO_FATAL_FAILURE(SetupLocationBar());
ASSERT_NO_FATAL_FAILURE(SetupPreview());
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
- ASSERT_EQ(ASCIIToUTF16("abcdef"), location_bar_->location_entry()->GetText());
+ ASSERT_EQ(ASCIIToUTF16("defghi"), location_bar_->location_entry()->GetText());
// Make sure the url that will get committed when we press enter matches that
// of the default search provider.
@@ -301,11 +303,11 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnChangeEvent) {
ASSERT_TRUE(default_turl);
ASSERT_TRUE(default_turl->url());
EXPECT_EQ(default_turl->url()->ReplaceSearchTerms(
- *default_turl, ASCIIToUTF16("abcdef"), 0, string16()),
+ *default_turl, ASCIIToUTF16("defghi"), 0, string16()),
browser()->instant()->GetCurrentURL().spec());
// Check that the value is reflected and onchange is called.
- EXPECT_EQ("true 0 0 1 2 a false abc false 3 3",
+ EXPECT_EQ("true 0 0 1 2 d false def false 3 3",
GetSearchStateAsString(preview_));
}
@@ -316,9 +318,9 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsArrayOfStrings) {
ASSERT_NO_FATAL_FAILURE(SetupLocationBar());
ASSERT_NO_FATAL_FAILURE(SetupPreview());
- SetSuggestionsJavascriptArgument(preview_, "['abcde', 'unused']");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
- EXPECT_STR_EQ("abcde", GetSuggestion());
+ SetSuggestionsJavascriptArgument(preview_, "['defgh', 'unused']");
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
+ EXPECT_STR_EQ("defgh", GetSuggestion());
}
IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsEmptyArray) {
@@ -329,7 +331,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsEmptyArray) {
ASSERT_NO_FATAL_FAILURE(SetupPreview());
SetSuggestionsJavascriptArgument(preview_, "[]");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
EXPECT_STR_EQ("", GetSuggestion());
}
@@ -342,9 +344,9 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsValidJson) {
SetSuggestionsJavascriptArgument(
preview_,
- "{suggestions:[{value:'abcdefg'},{value:'unused'}]}");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
- EXPECT_STR_EQ("abcdefg", GetSuggestion());
+ "{suggestions:[{value:'defghij'},{value:'unused'}]}");
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
+ EXPECT_STR_EQ("defghij", GetSuggestion());
}
IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsInvalidSuggestions) {
@@ -356,8 +358,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsInvalidSuggestions) {
SetSuggestionsJavascriptArgument(
preview_,
- "{suggestions:{value:'abcdefg'}}");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ "{suggestions:{value:'defghi'}}");
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
EXPECT_STR_EQ("", GetSuggestion());
}
@@ -369,7 +371,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsEmptyJson) {
ASSERT_NO_FATAL_FAILURE(SetupPreview());
SetSuggestionsJavascriptArgument(preview_, "{}");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
EXPECT_STR_EQ("", GetSuggestion());
}
@@ -381,7 +383,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsEmptySuggestions) {
ASSERT_NO_FATAL_FAILURE(SetupPreview());
SetSuggestionsJavascriptArgument(preview_, "{suggestions:[]}");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
EXPECT_STR_EQ("", GetSuggestion());
}
@@ -393,7 +395,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, SetSuggestionsEmptySuggestion) {
ASSERT_NO_FATAL_FAILURE(SetupPreview());
SetSuggestionsJavascriptArgument(preview_, "{suggestions:[{}]}");
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
EXPECT_STR_EQ("", GetSuggestion());
}
@@ -434,7 +436,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, NonSearchToSearch) {
// Now type in some search text.
ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("search.html"));
- location_bar_->location_entry()->SetUserText(ASCIIToUTF16("abc"));
+ location_bar_->location_entry()->SetUserText(ASCIIToUTF16("def"));
// Wait for the preview to navigate.
ASSERT_NO_FATAL_FAILURE(WaitForPreviewToNavigate(false));
@@ -466,7 +468,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, NonSearchToSearch) {
// Reset the user text so that the page is told the text changed. We should be
// able to nuke this once 66104 is fixed.
- location_bar_->location_entry()->SetUserText(ASCIIToUTF16("abcd"));
+ location_bar_->location_entry()->SetUserText(ASCIIToUTF16("defg"));
// Wait for the renderer to process it.
ASSERT_NO_FATAL_FAILURE(
@@ -503,7 +505,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE_SearchServerDoesntSupportInstant) {
EnableInstant();
ASSERT_NO_FATAL_FAILURE(SetupInstantProvider("empty.html"));
ASSERT_NO_FATAL_FAILURE(FindLocationBar());
- location_bar_->location_entry()->SetUserText(ASCIIToUTF16("a"));
+ location_bar_->location_entry()->SetUserText(ASCIIToUTF16("d"));
ASSERT_TRUE(browser()->instant());
// Because we typed in a search string we should think we're showing instant
// results.
@@ -553,7 +555,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest,
ASSERT_TRUE(rwhv->IsShowing());
// Now type in some search text.
- location_bar_->location_entry()->SetUserText(ASCIIToUTF16("a"));
+ location_bar_->location_entry()->SetUserText(ASCIIToUTF16("d"));
// Instant should still be live.
ASSERT_TRUE(browser()->instant()->is_displayable());
@@ -581,7 +583,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, ValidHeight) {
ASSERT_NO_FATAL_FAILURE(SetupLocationBar());
ASSERT_NO_FATAL_FAILURE(SetupPreview());
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
int height;
@@ -636,7 +638,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnSubmitEvent) {
ASSERT_NO_FATAL_FAILURE(SetupLocationBar());
ASSERT_NO_FATAL_FAILURE(SetupPreview());
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
ASSERT_NO_FATAL_FAILURE(SendKey(ui::VKEY_RETURN));
// Check that the preview contents have been committed.
@@ -646,7 +648,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnSubmitEvent) {
ASSERT_TRUE(contents);
// Check that the value is reflected and onsubmit is called.
- EXPECT_EQ("true 1 0 1 2 a false abcdef true 3 3",
+ EXPECT_EQ("true 1 0 1 2 d false defghi true 3 3",
GetSearchStateAsString(preview_));
}
@@ -660,7 +662,7 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnCancelEvent) {
ASSERT_NO_FATAL_FAILURE(SetupLocationBar());
ASSERT_NO_FATAL_FAILURE(SetupPreview());
- ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"abc"));
+ ASSERT_NO_FATAL_FAILURE(SetLocationBarText(L"def"));
ASSERT_NO_FATAL_FAILURE(ui_test_utils::ClickOnView(browser(),
VIEW_ID_TAB_CONTAINER));
@@ -671,6 +673,6 @@ IN_PROC_BROWSER_TEST_F(InstantTest, OnCancelEvent) {
ASSERT_TRUE(contents);
// Check that the value is reflected and oncancel is called.
- EXPECT_EQ("true 0 1 1 2 a false abc false 3 3",
+ EXPECT_EQ("true 0 1 1 2 d false def false 3 3",
GetSearchStateAsString(preview_));
}
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index d0a5f90..effb387 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -130,6 +130,8 @@
'browser/autocomplete/autocomplete_popup_view_gtk.h',
'browser/autocomplete/autocomplete_popup_view_mac.h',
'browser/autocomplete/autocomplete_popup_view_mac.mm',
+ 'browser/autocomplete/builtin_provider.cc',
+ 'browser/autocomplete/builtin_provider.h',
'browser/autocomplete/history_contents_provider.cc',
'browser/autocomplete/history_contents_provider.h',
'browser/autocomplete/history_provider.cc',
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc
index 36e0aea..5ac9ea1 100644
--- a/chrome/common/url_constants.cc
+++ b/chrome/common/url_constants.cc
@@ -67,7 +67,6 @@ const char kAboutShorthangURL[] = "about:shorthang";
const char kAboutSyncURL[] = "about:sync";
const char kAboutSyncInternalsURL[] = "about:sync-internals";
const char kAboutTermsURL[] = "about:terms";
-const char kAboutVaporwareURL[] = "about:vaporware";
const char kAboutVersionURL[] = "about:version";
// Use an obfuscated URL to make this nondiscoverable, we only want this
diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h
index c4a58d7..8f2d3aa 100644
--- a/chrome/common/url_constants.h
+++ b/chrome/common/url_constants.h
@@ -61,7 +61,6 @@ extern const char kAboutShorthangURL[];
extern const char kAboutSyncURL[];
extern const char kAboutSyncInternalsURL[];
extern const char kAboutTermsURL[];
-extern const char kAboutVaporwareURL[];
extern const char kAboutVersionURL[];
// chrome: URLs (including schemes). Should be kept in sync with the
diff --git a/chrome/test/data/instant/nosearch.html b/chrome/test/data/instant/nosearch.html
deleted file mode 100644
index dc8cbaa..0000000
--- a/chrome/test/data/instant/nosearch.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<html>
-<body>
-<h1>No instant support</h1>
-<div id=log></div>
-<script>
-window.chrome.sv = false;
-
-window.onsubmitcalls = 0;
-window.onchangecalls = 0;
-window.oncancelcalls = 0;
-window.onresizecalls = 0;
-
-var searchBox = window.chrome.searchBox || {};
-
-window.beforeLoadSearchBox = {};
-for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop];
-
-window.chrome.searchBox.onsubmit = function() {
- searchBox.setSuggestions(["abcdef"]);
- window.onsubmitcalls++;
-};
-
-window.chrome.searchBox.onchange = function() {
- searchBox.setSuggestions(["abcdef"]);
- window.onchangecalls++;
-};
-
-window.chrome.searchBox.oncancel = function() {
- searchBox.setSuggestions(["abcdef"]);
- window.oncancelcalls++;
-};
-
-window.chrome.searchBox.onresize = function() {
- window.onresizecalls++;
-};
-</script>
-</body>
-</html>
diff --git a/chrome/test/data/instant/search.html b/chrome/test/data/instant/search.html
index 7e68897..d2b2e72 100644
--- a/chrome/test/data/instant/search.html
+++ b/chrome/test/data/instant/search.html
@@ -17,7 +17,7 @@ for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop];
window.setSuggestionsArgument = {
suggestions: [
- { value: "abcdef" }
+ { value: "defghi" }
]
};