| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/test/integration/search_engines_helper.h" | 5 #include "chrome/browser/sync/test/integration/search_engines_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 TemplateURLData data; | 197 TemplateURLData data; |
| 198 data.short_name = CreateKeyword(seed); | 198 data.short_name = CreateKeyword(seed); |
| 199 data.SetKeyword(keyword); | 199 data.SetKeyword(keyword); |
| 200 data.SetURL(url); | 200 data.SetURL(url); |
| 201 data.favicon_url = GURL("http://favicon.url"); | 201 data.favicon_url = GURL("http://favicon.url"); |
| 202 data.safe_for_autoreplace = true; | 202 data.safe_for_autoreplace = true; |
| 203 data.date_created = base::Time::FromTimeT(100); | 203 data.date_created = base::Time::FromTimeT(100); |
| 204 data.last_modified = base::Time::FromTimeT(100); | 204 data.last_modified = base::Time::FromTimeT(100); |
| 205 data.prepopulate_id = 999999; | 205 data.prepopulate_id = 999999; |
| 206 data.sync_guid = sync_guid; | 206 data.sync_guid = sync_guid; |
| 207 return new TemplateURL(profile, data); | 207 return new TemplateURL(data); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void AddSearchEngine(int profile_index, int seed) { | 210 void AddSearchEngine(int profile_index, int seed) { |
| 211 Profile* profile = test()->GetProfile(profile_index); | 211 Profile* profile = test()->GetProfile(profile_index); |
| 212 TemplateURLServiceFactory::GetForProfile(profile)->Add( | 212 TemplateURLServiceFactory::GetForProfile(profile)->Add( |
| 213 CreateTestTemplateURL(profile, seed)); | 213 CreateTestTemplateURL(profile, seed)); |
| 214 if (test()->use_verifier()) | 214 if (test()->use_verifier()) |
| 215 GetVerifierService()->Add(CreateTestTemplateURL(profile, seed)); | 215 GetVerifierService()->Add(CreateTestTemplateURL(profile, seed)); |
| 216 } | 216 } |
| 217 | 217 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 service->SetUserSelectedDefaultSearchProvider(turl); | 259 service->SetUserSelectedDefaultSearchProvider(turl); |
| 260 if (test()->use_verifier()) { | 260 if (test()->use_verifier()) { |
| 261 TemplateURL* verifier_turl = | 261 TemplateURL* verifier_turl = |
| 262 GetVerifierService()->GetTemplateURLForKeyword(CreateKeyword(seed)); | 262 GetVerifierService()->GetTemplateURLForKeyword(CreateKeyword(seed)); |
| 263 ASSERT_TRUE(verifier_turl); | 263 ASSERT_TRUE(verifier_turl); |
| 264 GetVerifierService()->SetUserSelectedDefaultSearchProvider(verifier_turl); | 264 GetVerifierService()->SetUserSelectedDefaultSearchProvider(verifier_turl); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 } // namespace search_engines_helper | 268 } // namespace search_engines_helper |
| OLD | NEW |