Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: chrome/browser/search_engines/template_url.cc

Issue 10458077: When the Google base URL changes and causes keyword updates, save those to the database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url.h ('k') | chrome/browser/search_engines/template_url_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698