diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-14 18:54:24 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-14 18:54:24 +0000 |
commit | 6a4e3339fc88762e909ce54b16a44d7bc57fa012 (patch) | |
tree | 669cd8deb9dc3ea983e42b57a32b279190de7468 /chrome/browser/search_engines | |
parent | df6412c9b03cc76bd96f32a77c71247a68ac7254 (diff) | |
download | chromium_src-6a4e3339fc88762e909ce54b16a44d7bc57fa012.zip chromium_src-6a4e3339fc88762e909ce54b16a44d7bc57fa012.tar.gz chromium_src-6a4e3339fc88762e909ce54b16a44d7bc57fa012.tar.bz2 |
Lands http://codereview.chromium.org/551010 for avayvod:
Disabled Remove button if there's only one URL in the list.
Added requirement for the default search engine URL to have %s when
editing.
BUG=2714
TEST=See the bug description for reproduction steps.
Review URL: http://codereview.chromium.org/543061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r-- | chrome/browser/search_engines/edit_search_engine_controller.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/search_engines/edit_search_engine_controller.cc b/chrome/browser/search_engines/edit_search_engine_controller.cc index 8151603..9e3d5d7 100644 --- a/chrome/browser/search_engines/edit_search_engine_controller.cc +++ b/chrome/browser/search_engines/edit_search_engine_controller.cc @@ -38,8 +38,14 @@ bool EditSearchEngineController::IsURLValid( if (!template_ref.IsValid()) return false; - if (!template_ref.SupportsReplacement()) + if (!template_ref.SupportsReplacement()) { + // If this is the default search engine, there must be a search term + // placeholder. + if (template_url_ == + profile_->GetTemplateURLModel()->GetDefaultSearchProvider()) + return false; return GURL(WideToUTF16Hack(url)).is_valid(); + } // If the url has a search term, replace it with a random string and make // sure the resulting URL is valid. We don't check the validity of the url |