| 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/search_engines/template_url.h" | 5 #include "chrome/browser/search_engines/template_url.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/icu_string_conversions.h" | 8 #include "base/i18n/icu_string_conversions.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 } | 679 } |
| 680 | 680 |
| 681 void TemplateURL::ResetKeywordIfNecessary(bool force) { | 681 void TemplateURL::ResetKeywordIfNecessary(bool force) { |
| 682 if (IsGoogleSearchURLWithReplaceableKeyword() || force) { | 682 if (IsGoogleSearchURLWithReplaceableKeyword() || force) { |
| 683 DCHECK(!IsExtensionKeyword()); | 683 DCHECK(!IsExtensionKeyword()); |
| 684 GURL url(TemplateURLService::GenerateSearchURL(this)); | 684 GURL url(TemplateURLService::GenerateSearchURL(this)); |
| 685 if (url.is_valid()) | 685 if (url.is_valid()) |
| 686 data_.SetKeyword(TemplateURLService::GenerateKeyword(url)); | 686 data_.SetKeyword(TemplateURLService::GenerateKeyword(url)); |
| 687 } | 687 } |
| 688 } | 688 } |
| 689 | |
| 690 void TemplateURL::InvalidateCachedValues() { | |
| 691 url_ref_.InvalidateCachedValues(); | |
| 692 suggestions_url_ref_.InvalidateCachedValues(); | |
| 693 instant_url_ref_.InvalidateCachedValues(); | |
| 694 ResetKeywordIfNecessary(false); | |
| 695 } | |
| OLD | NEW |