OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/search_engines/template_url_model.h" | 5 #include "chrome/browser/search_engines/template_url_model.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/extensions/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 // Don't mark the url as edited, otherwise we won't be able to rev the | 495 // Don't mark the url as edited, otherwise we won't be able to rev the |
496 // templateurls we ship with. | 496 // templateurls we ship with. |
497 modifiable_url->set_show_in_default_list(true); | 497 modifiable_url->set_show_in_default_list(true); |
498 if (service_.get()) | 498 if (service_.get()) |
499 service_.get()->UpdateKeyword(*url); | 499 service_.get()->UpdateKeyword(*url); |
500 | 500 |
501 const TemplateURLRef* url_ref = url->url(); | 501 const TemplateURLRef* url_ref = url->url(); |
502 if (url_ref && url_ref->HasGoogleBaseURLs()) { | 502 if (url_ref && url_ref->HasGoogleBaseURLs()) { |
503 GoogleURLTracker::RequestServerCheck(); | 503 GoogleURLTracker::RequestServerCheck(); |
504 #if defined(OS_WIN) | 504 #if defined(OS_WIN) |
505 RLZTracker::RecordProductEvent(RLZTracker::CHROME, | 505 RLZTracker::RecordProductEvent(rlz_lib::CHROME, |
506 RLZTracker::CHROME_OMNIBOX, | 506 rlz_lib::CHROME_OMNIBOX, |
507 RLZTracker::SET_TO_GOOGLE); | 507 rlz_lib::SET_TO_GOOGLE); |
508 #endif | 508 #endif |
509 } | 509 } |
510 } | 510 } |
511 | 511 |
512 SaveDefaultSearchProviderToPrefs(url); | 512 SaveDefaultSearchProviderToPrefs(url); |
513 | 513 |
514 if (service_.get()) | 514 if (service_.get()) |
515 service_->SetDefaultSearchProvider(url); | 515 service_->SetDefaultSearchProvider(url); |
516 | 516 |
517 if (loaded_) { | 517 if (loaded_) { |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 const TemplateURL* TemplateURLModel::GetTemplateURLForExtension( | 1095 const TemplateURL* TemplateURLModel::GetTemplateURLForExtension( |
1096 Extension* extension) const { | 1096 Extension* extension) const { |
1097 for (TemplateURLVector::const_iterator i = template_urls_.begin(); | 1097 for (TemplateURLVector::const_iterator i = template_urls_.begin(); |
1098 i != template_urls_.end(); ++i) { | 1098 i != template_urls_.end(); ++i) { |
1099 if ((*i)->IsExtensionKeyword() && (*i)->url()->GetHost() == extension->id()) | 1099 if ((*i)->IsExtensionKeyword() && (*i)->url()->GetHost() == extension->id()) |
1100 return *i; | 1100 return *i; |
1101 } | 1101 } |
1102 | 1102 |
1103 return NULL; | 1103 return NULL; |
1104 } | 1104 } |
OLD | NEW |