summaryrefslogtreecommitdiffstats
path: root/chrome/browser/instant
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 20:17:55 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 20:17:55 +0000
commit3954c3a76994f8e3a8eec65f4d90580ba8ab0e80 (patch)
tree638d7ff635e7bda3f037785a2096f36ed7bb21c7 /chrome/browser/instant
parent6fae79736f73e541b0ec3951adb1c4f83ba7428e (diff)
downloadchromium_src-3954c3a76994f8e3a8eec65f4d90580ba8ab0e80.zip
chromium_src-3954c3a76994f8e3a8eec65f4d90580ba8ab0e80.tar.gz
chromium_src-3954c3a76994f8e3a8eec65f4d90580ba8ab0e80.tar.bz2
More misc. cleanups to minimize future refactoring diffs:
* Fix indentation * Slightly more const-correct TemplateURLData functions * Use EXPECT_XXX() where possible, but ASSERT_XXX() to avoid crashes on expectation failure * Remove unneeded #include * Simplify AlternateErrorPageTabObserver slightly by having constructor take a Profile * Shorter/simpler code * Fix ordering in some places to be more consistent (e.g. matching member declaration order) * Add some DCHECK()s to make more explicit some conditions that will become important later Also, template_url_service.cc has some functional changes: * GetTemplateURLForXXX() functions now return correct values when asked for the default search URL before the model has successfully loaded. I wound up needing this later to fix some case, but I forget what now; the change seems more correct anyway. * Similarly, UnregisterExtensionKeyword() now works correctly if called before loading has finished * RegisterExtensionKeyword() now does nothing when there's already a keyword for that extension, as the comments in the header claim. I'd think this wouldn't actually matter in normal use as I think extension upgrades first unregister the old extension? (I don't remember if I checked that, though) * Don't try to set an extension keyword as default -- this would be a bad UX as these are inherently async. I don't think this should have been possible anyway except maybe if there was some kind of unintentional overlap between extensions and policy?? * Don't try to save extension keywords to disk or sync them (as the extension system should be responsible for registering them if necessary on startup in both these cases). We already avoided syncing these, I just added checks in more places; I no longer recall if we had code to avoid persisting these to disk, I don't seem to see any at the moment. (sky?) BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10033017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131619 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/instant')
-rw-r--r--chrome/browser/instant/instant_browsertest.cc3
-rw-r--r--chrome/browser/instant/instant_loader.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/instant/instant_browsertest.cc b/chrome/browser/instant/instant_browsertest.cc
index eec6b18..45d38be 100644
--- a/chrome/browser/instant/instant_browsertest.cc
+++ b/chrome/browser/instant/instant_browsertest.cc
@@ -279,7 +279,8 @@ IN_PROC_BROWSER_TEST_F(InstantTest, MAYBE(OnChangeEvent)) {
GetDefaultSearchProvider();
EXPECT_TRUE(default_turl);
EXPECT_EQ(default_turl->url_ref().ReplaceSearchTerms(ASCIIToUTF16("defghi"),
- 0, string16()), loader()->url().spec());
+ TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()),
+ loader()->url().spec());
// Check that the value is reflected and onchange is called.
EXPECT_EQ("true 0 0 1 true d false def false 3 3",
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index e6feafe..dce9349 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -1129,7 +1129,8 @@ void InstantLoader::LoadInstantURL(TabContentsWrapper* tab_contents,
// TODO(sky): having to use a replaceable url is a bit of a hack here.
GURL instant_url(
template_url->instant_url_ref().ReplaceSearchTermsUsingProfile(
- tab_contents->profile(), string16(), -1, string16()));
+ tab_contents->profile(), string16(),
+ TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()));
CommandLine* cl = CommandLine::ForCurrentProcess();
if (cl->HasSwitch(switches::kInstantURL))
instant_url = GURL(cl->GetSwitchValueASCII(switches::kInstantURL));