Home | History | Annotate | Download | only in search_engines

Lines Matching refs:TemplateURL

58 bool IdenticalSyncGUIDs(const TemplateURLData* data, const TemplateURL* turl) {
131 // this so that code can calculate a TemplateURL's previous search URL after a
162 bool IsFromSync(const TemplateURL* turl, const SyncDataMap& sync_data) {
416 const TemplateURL* t_url,
440 DCHECK_EQ(TemplateURL::NORMAL, t_url->GetType());
491 TemplateURL** template_url_to_replace) {
495 TemplateURL* existing_url = GetTemplateURLForKeyword(keyword);
499 // We already have a TemplateURL for this keyword. Only allow it to be
500 // replaced if the TemplateURL can be replaced.
504 // We don't have a TemplateURL with keyword. Only allow a new one if there
505 // isn't a TemplateURL for the specified host, or there is one but it can
507 // keyword to a generated TemplateURL, we won't regenerate another keyword for
524 TemplateURL* const kNullTemplateURL = NULL;
545 TemplateURL* TemplateURLService::GetTemplateURLForKeyword(
557 TemplateURL* TemplateURLService::GetTemplateURLForGUID(
568 TemplateURL* TemplateURLService::GetTemplateURLForHost(
572 TemplateURL* initial_dsp = initial_default_search_provider_.get();
579 bool TemplateURLService::Add(TemplateURL* template_url) {
587 void TemplateURLService::AddWithOverrides(TemplateURL* template_url,
600 TemplateURL* template_url,
611 TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION));
621 void TemplateURLService::Remove(TemplateURL* template_url) {
629 TemplateURL* url = FindTemplateURLForExtension(
630 extension_id, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
685 TemplateURL::OMNIBOX_API_EXTENSION)) {
694 TemplateURL* url = FindTemplateURLForExtension(
695 extension_id, TemplateURL::OMNIBOX_API_EXTENSION);
704 void TemplateURLService::IncrementUsageCount(TemplateURL* url) {
707 if (url->GetType() == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION)
718 void TemplateURLService::ResetTemplateURL(TemplateURL* url,
726 bool TemplateURLService::CanMakeDefault(const TemplateURL* url) {
733 (url->GetType() == TemplateURL::NORMAL);
737 TemplateURL* url) {
741 DCHECK(!url || (url->GetType() == TemplateURL::NORMAL));
760 TemplateURL* TemplateURLService::GetDefaultSearchProvider() {
767 TemplateURL* default_provider = GetDefaultSearchProvider();
800 for (std::vector<TemplateURL*>::iterator i = actions.removed_engines.begin();
808 TemplateURL new_values(i->second);
817 AddNoNotify(new TemplateURL(*i), true);
932 const TemplateURL* template_url = GetTemplateURLForKeyword(keyword);
938 template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION;
978 if ((*iter)->GetType() == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION)
1016 TemplateURL* existing_turl = GetTemplateURLForGUID(guid);
1017 scoped_ptr<TemplateURL> turl(CreateTemplateURLFromTemplateURLAndSyncData(
1027 TemplateURL* existing_keyword_turl =
1054 TemplateURL new_turl(data);
1086 TemplateURL* added = new TemplateURL(data);
1169 TemplateURL* local_turl = GetTemplateURLForGUID(iter->first);
1170 scoped_ptr<TemplateURL> sync_turl(
1197 // fields in the local TemplateURL. Note that this includes the
1198 // TemplateURLID and the TemplateURL may have to be reparsed. This
1263 const TemplateURL* turl,
1279 if (turl->GetType() == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION)
1294 const TemplateURL& turl) {
1336 TemplateURL* TemplateURLService::CreateTemplateURLFromTemplateURLAndSyncData(
1338 TemplateURL* existing_turl,
1400 TemplateURL* turl = new TemplateURL(data);
1402 // If this TemplateURL matches a built-in prepopulated template URL, it's
1406 DCHECK_NE(TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION, turl->GetType());
1416 // We're adding a new TemplateURL that uses the Google base URL, so set
1445 const TemplateURL* t_url,
1502 // TemplateURLService ends up owning the TemplateURL, don't try and free
1508 TemplateURL* template_url = new TemplateURL(data);
1519 TemplateURL* default_search_provider = GetDefaultSearchProvider();
1532 void TemplateURLService::RemoveFromMaps(TemplateURL* template_url) {
1537 // TemplateURL. See the comments in AddToMaps() for more information on
1542 TemplateURL* best_fallback = NULL;
1545 TemplateURL* turl = *i;
1547 // non-Omnibox API TemplateURL with a given keyword.
1550 (best_fallback->GetType() != TemplateURL::OMNIBOX_API_EXTENSION) ||
1551 ((turl->GetType() == TemplateURL::OMNIBOX_API_EXTENSION) &&
1569 void TemplateURLService::AddToMaps(TemplateURL* template_url) {
1571 template_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION;
1578 const TemplateURL* existing_url = i->second;
1584 existing_url->GetType() == TemplateURL::OMNIBOX_API_EXTENSION;
1601 bool HasValidID(TemplateURL* t_url) {
1651 TemplateURL** to_replace) {
1666 bool TemplateURLService::CanReplace(const TemplateURL* t_url) {
1671 TemplateURL* TemplateURLService::FindNonExtensionTemplateURLForKeyword(
1673 TemplateURL* keyword_turl = GetTemplateURLForKeyword(keyword);
1674 if (!keyword_turl || (keyword_turl->GetType() == TemplateURL::NORMAL))
1680 if (((*i)->GetType() == TemplateURL::NORMAL) &&
1688 TemplateURL* existing_turl,
1689 const TemplateURL& new_values,
1728 TemplateURL* existing_keyword_turl = i->second;
1729 if (existing_keyword_turl->GetType() != TemplateURL::NORMAL) {
1761 TemplateURL* template_url,
1775 template_url->CopyFrom(TemplateURL(*prepopulated_urls[i]));
1780 void TemplateURLService::MaybeUpdateDSEAfterSync(TemplateURL* synced_turl) {
1822 void TemplateURLService::AddTabToSearchVisit(const TemplateURL& t_url) {
1856 TemplateURL* t_url = *i;
1858 TemplateURL updated_turl(t_url->data());
1864 // The new autogenerated keyword conflicts with another TemplateURL.
1867 // the keyword in the future if the conflicting TemplateURL disappears.)
1930 bool changed = TemplateURL::MatchesData(
1933 data ? new TemplateURL(*data) : NULL);
1943 TemplateURL::MatchesData(default_search_provider_, data,
1949 TemplateURL* previous_default_search_engine = default_search_provider_;
1965 *data, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
1978 TemplateURL(update_data),
1986 TemplateURL* new_dse = new TemplateURL(*data);
2000 TemplateURL(new_data),
2004 TemplateURL* new_dse = new TemplateURL(new_data);
2033 bool TemplateURLService::AddNoNotify(TemplateURL* template_url,
2047 TemplateURL* existing_keyword_turl =
2085 TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION)) {
2099 void TemplateURLService::RemoveNoNotify(TemplateURL* template_url) {
2112 if (template_url->GetType() != TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION) {
2134 // We own the TemplateURL and need to delete it.
2139 TemplateURL* url,
2155 return UpdateNoNotify(url, TemplateURL(data), search_terms_data());
2180 TemplateURL* template_url = *i;
2183 TemplateURL::MatchesData(template_url, default_from_prefs,
2213 TemplateURL* new_dse = new TemplateURL(new_data);
2219 void TemplateURLService::ResetTemplateURLGUID(TemplateURL* url,
2226 UpdateNoNotify(url, TemplateURL(data), search_terms_data());
2229 base::string16 TemplateURLService::UniquifyKeyword(const TemplateURL& turl,
2236 // First, try to return the generated keyword for the TemplateURL (except
2240 (turl.GetType() != TemplateURL::OMNIBOX_API_EXTENSION)) {
2241 base::string16 keyword_candidate = TemplateURL::GenerateKeyword(gurl);
2259 const TemplateURL* local_turl,
2260 const TemplateURL* sync_turl) {
2268 TemplateURL* unapplied_sync_turl,
2269 TemplateURL* applied_sync_turl,
2276 DCHECK_NE(TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION,
2285 TemplateURL* loser = applied_turl_is_better ?
2298 applied_sync_turl, TemplateURL(data), search_terms_data()))
2301 // The losing TemplateURL should have their keyword updated. Send a change to
2310 TemplateURL* sync_turl,
2319 TemplateURL* conflicting_turl =
2323 // If there was no TemplateURL in the local model that conflicts with
2347 // Note that in this case we do not add the Sync TemplateURL to the
2361 // This TemplateURL was either removed or overwritten in the local model.
2371 TemplateURL* added = new TemplateURL(data);
2386 TemplateURL* template_url = *i;
2390 TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION)) {
2409 TemplateURL* turl = GetTemplateURLForGUID(new_guid);
2414 TemplateURL* TemplateURLService::FindPrepopulatedTemplateURL(
2424 TemplateURL* TemplateURLService::CreateTemplateURLForExtension(
2430 // ID, as well as forcing the TemplateURL to be treated as a search keyword.
2433 return new TemplateURL(data);
2436 TemplateURL* TemplateURLService::FindTemplateURLForExtension(
2438 TemplateURL::Type type) {
2439 DCHECK_NE(TemplateURL::NORMAL, type);
2449 TemplateURL* TemplateURLService::FindMatchingExtensionTemplateURL(
2451 TemplateURL::Type type) {
2452 DCHECK_NE(TemplateURL::NORMAL, type);
2456 TemplateURL::MatchesData(*i, &data, search_terms_data()))
2463 TemplateURL* most_recently_intalled_default = NULL;
2466 if (((*i)->GetType() == TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION) &&