Home | History | Annotate | Download | only in search_engines

Lines Matching defs:template_url

24 #include "chrome/browser/search_engines/template_url.h"
62 TemplateURL* template_url = *i;
63 if (template_url->created_by_policy()) {
65 (*default_search_provider)->id() == template_url->id())
68 delete template_url;
289 void TemplateURLModel::Add(TemplateURL* template_url) {
290 AddNoNotify(template_url);
294 void TemplateURLModel::Remove(const TemplateURL* template_url) {
295 RemoveNoNotify(template_url);
335 scoped_ptr<TemplateURL> template_url(new TemplateURL);
336 template_url->set_short_name(UTF8ToUTF16(extension->name()));
337 template_url->set_keyword(keyword);
340 template_url->SetURL(
343 template_url->set_safe_for_autoreplace(false);
348 UpdateNoNotify(existing_url, *template_url);
350 AddNoNotify(template_url.release());
553 const TemplateURL* template_url = GetTemplateURLForKeyword(keyword);
557 if (template_url) {
558 *is_extension_keyword = template_url->IsExtensionKeyword();
559 return template_url->AdjustedShortNameForLocaleDirection();
659 TemplateURL* template_url = new TemplateURL();
660 template_url->set_keyword(UTF8ToUTF16(initializers[i].keyword));
661 template_url->set_short_name(UTF8ToUTF16(initializers[i].content));
662 template_url->SetURL(osd_url, 0, 0);
663 AddNoNotify(template_url);
684 void TemplateURLModel::RemoveFromMaps(const TemplateURL* template_url) {
685 if (!template_url->keyword().empty())
686 keyword_to_template_map_.erase(template_url->keyword());
688 provider_map_.Remove(template_url);
692 const TemplateURL* template_url) {
693 DCHECK(template_url);
696 if (i->second == template_url) {
705 void TemplateURLModel::AddToMaps(const TemplateURL* template_url) {
706 if (!template_url->keyword().empty())
707 keyword_to_template_map_[template_url->keyword()] = template_url;
710 provider_map_.Add(template_url, search_terms_data);
1218 void TemplateURLModel::AddNoNotify(TemplateURL* template_url) {
1219 DCHECK(template_url);
1220 DCHECK(template_url->id() == 0);
1221 DCHECK(find(template_urls_.begin(), template_urls_.end(), template_url) ==
1223 template_url->set_id(++next_id_);
1224 template_urls_.push_back(template_url);
1225 AddToMaps(template_url);
1228 service_->AddKeyword(*template_url);
1231 void TemplateURLModel::RemoveNoNotify(const TemplateURL* template_url) {
1234 template_url);
1238 if (template_url == default_search_provider_) {
1244 RemoveFromMaps(template_url);
1250 service_->RemoveKeyword(*template_url);
1254 TemplateURLID id = template_url->id();
1262 delete template_url;