| 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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 TemplateURL* modifiable_url = const_cast<TemplateURL*>(url); | 495 TemplateURL* modifiable_url = const_cast<TemplateURL*>(url); |
| 496 // Don't mark the url as edited, otherwise we won't be able to rev the | 496 // Don't mark the url as edited, otherwise we won't be able to rev the |
| 497 // templateurls we ship with. | 497 // templateurls we ship with. |
| 498 modifiable_url->set_show_in_default_list(true); | 498 modifiable_url->set_show_in_default_list(true); |
| 499 if (service_.get()) | 499 if (service_.get()) |
| 500 service_.get()->UpdateKeyword(*url); | 500 service_.get()->UpdateKeyword(*url); |
| 501 | 501 |
| 502 const TemplateURLRef* url_ref = url->url(); | 502 const TemplateURLRef* url_ref = url->url(); |
| 503 if (url_ref && url_ref->HasGoogleBaseURLs()) { | 503 if (url_ref && url_ref->HasGoogleBaseURLs()) { |
| 504 GoogleURLTracker::RequestServerCheck(); | 504 GoogleURLTracker::RequestServerCheck(); |
| 505 #if defined(OS_WIN) | 505 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
| 506 RLZTracker::RecordProductEvent(rlz_lib::CHROME, | 506 RLZTracker::RecordProductEvent(rlz_lib::CHROME, |
| 507 rlz_lib::CHROME_OMNIBOX, | 507 rlz_lib::CHROME_OMNIBOX, |
| 508 rlz_lib::SET_TO_GOOGLE); | 508 rlz_lib::SET_TO_GOOGLE); |
| 509 #endif | 509 #endif |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 | 512 |
| 513 SaveDefaultSearchProviderToPrefs(url); | 513 SaveDefaultSearchProviderToPrefs(url); |
| 514 | 514 |
| 515 if (service_.get()) | 515 if (service_.get()) |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 const TemplateURL* TemplateURLModel::GetTemplateURLForExtension( | 1106 const TemplateURL* TemplateURLModel::GetTemplateURLForExtension( |
| 1107 Extension* extension) const { | 1107 Extension* extension) const { |
| 1108 for (TemplateURLVector::const_iterator i = template_urls_.begin(); | 1108 for (TemplateURLVector::const_iterator i = template_urls_.begin(); |
| 1109 i != template_urls_.end(); ++i) { | 1109 i != template_urls_.end(); ++i) { |
| 1110 if ((*i)->IsExtensionKeyword() && (*i)->url()->GetHost() == extension->id()) | 1110 if ((*i)->IsExtensionKeyword() && (*i)->url()->GetHost() == extension->id()) |
| 1111 return *i; | 1111 return *i; |
| 1112 } | 1112 } |
| 1113 | 1113 |
| 1114 return NULL; | 1114 return NULL; |
| 1115 } | 1115 } |
| OLD | NEW |