diff options
| author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 20:27:37 +0000 |
|---|---|---|
| committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-27 20:27:37 +0000 |
| commit | 3613347db32e0112c044854949072cd3e7d6e213 (patch) | |
| tree | 1e9bc2aa368a217d4ffd5d30d85f50cd262af07d /chrome/browser/sync/test/integration/search_engines_helper.cc | |
| parent | f39ed01df297378dc80b670cec60456e5e25cc35 (diff) | |
| download | chromium_src-3613347db32e0112c044854949072cd3e7d6e213.zip chromium_src-3613347db32e0112c044854949072cd3e7d6e213.tar.gz chromium_src-3613347db32e0112c044854949072cd3e7d6e213.tar.bz2 | |
Remove const qualifiers on "TemplateURL*" in many TemplateURLService APIs. This has followon effects in many other places, most noticeably ConfirmAddSearchProvider(), which seems to be declared in like 20 files :P
This removes most const_cast<>()s and makes the TemplateURLService APIs a lot more accurate about when the URLs they take or return can be modified. Note that because most of TemplateURL is now immutable except to friends, this doesn't actually give callers dangerous latitude in mucking with TemplateURLs.
This does add a few const_cast<>()s related to keyword autogeneration. Keyword autogeneration will die soon so I didn't care about finding ways around these.
BUG=none
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10209018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/test/integration/search_engines_helper.cc')
| -rw-r--r-- | chrome/browser/sync/test/integration/search_engines_helper.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/chrome/browser/sync/test/integration/search_engines_helper.cc b/chrome/browser/sync/test/integration/search_engines_helper.cc index 1a9f4e0..f84c3b1 100644 --- a/chrome/browser/sync/test/integration/search_engines_helper.cc +++ b/chrome/browser/sync/test/integration/search_engines_helper.cc @@ -221,13 +221,13 @@ void EditSearchEngine(int profile_index, const std::string& url) { DCHECK(!url.empty()); TemplateURLService* service = GetServiceForProfile(profile_index); - const TemplateURL* turl = service->GetTemplateURLForKeyword(keyword); + TemplateURL* turl = service->GetTemplateURLForKeyword(keyword); EXPECT_TRUE(turl); ASSERT_FALSE(new_keyword.empty()); service->ResetTemplateURL(turl, short_name, new_keyword, url); // Make sure we do the same on the verifier. if (test()->use_verifier()) { - const TemplateURL* verifier_turl = + TemplateURL* verifier_turl = GetVerifierService()->GetTemplateURLForKeyword(keyword); EXPECT_TRUE(verifier_turl); GetVerifierService()->ResetTemplateURL(verifier_turl, short_name, @@ -238,12 +238,12 @@ void EditSearchEngine(int profile_index, void DeleteSearchEngineBySeed(int profile_index, int seed) { TemplateURLService* service = GetServiceForProfile(profile_index); string16 keyword(CreateKeyword(seed)); - const TemplateURL* turl = service->GetTemplateURLForKeyword(keyword); + TemplateURL* turl = service->GetTemplateURLForKeyword(keyword); EXPECT_TRUE(turl); service->Remove(turl); // Make sure we do the same on the verifier. if (test()->use_verifier()) { - const TemplateURL* verifier_turl = + TemplateURL* verifier_turl = GetVerifierService()->GetTemplateURLForKeyword(keyword); EXPECT_TRUE(verifier_turl); GetVerifierService()->Remove(verifier_turl); @@ -253,12 +253,11 @@ void DeleteSearchEngineBySeed(int profile_index, int seed) { void ChangeDefaultSearchProvider(int profile_index, int seed) { TemplateURLService* service = GetServiceForProfile(profile_index); ASSERT_TRUE(service); - const TemplateURL* turl = - service->GetTemplateURLForKeyword(CreateKeyword(seed)); + TemplateURL* turl = service->GetTemplateURLForKeyword(CreateKeyword(seed)); ASSERT_TRUE(turl); service->SetDefaultSearchProvider(turl); if (test()->use_verifier()) { - const TemplateURL* verifier_turl = + TemplateURL* verifier_turl = GetVerifierService()->GetTemplateURLForKeyword(CreateKeyword(seed)); ASSERT_TRUE(verifier_turl); GetVerifierService()->SetDefaultSearchProvider(verifier_turl); |
