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

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

Issue 147145: Fix: Certain redirections remove sites from the history... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
947 return; 947 return;
948 948
949 GURL url(URLFixerUpper::FixupURL(WideToUTF8(t_url.keyword()), std::string())); 949 GURL url(URLFixerUpper::FixupURL(WideToUTF8(t_url.keyword()), std::string()));
950 if (!url.is_valid()) 950 if (!url.is_valid())
951 return; 951 return;
952 952
953 // Synthesize a visit for the keyword. This ensures the url for the keyword is 953 // Synthesize a visit for the keyword. This ensures the url for the keyword is
954 // autocompleted even if the user doesn't type the url in directly. 954 // autocompleted even if the user doesn't type the url in directly.
955 history->AddPage(url, NULL, 0, GURL(), 955 history->AddPage(url, NULL, 0, GURL(),
956 PageTransition::KEYWORD_GENERATED, 956 PageTransition::KEYWORD_GENERATED,
957 HistoryService::RedirectList()); 957 HistoryService::RedirectList(), false);
958 } 958 }
959 959
960 // static 960 // static
961 bool TemplateURLModel::BuildQueryTerms(const GURL& url, 961 bool TemplateURLModel::BuildQueryTerms(const GURL& url,
962 QueryTerms* query_terms) { 962 QueryTerms* query_terms) {
963 url_parse::Component query = url.parsed_for_possibly_invalid_spec().query; 963 url_parse::Component query = url.parsed_for_possibly_invalid_spec().query;
964 url_parse::Component key, value; 964 url_parse::Component key, value;
965 size_t valid_term_count = 0; 965 size_t valid_term_count = 0;
966 while (url_parse::ExtractQueryKeyValue(url.spec().c_str(), &query, &key, 966 while (url_parse::ExtractQueryKeyValue(url.spec().c_str(), &query, &key,
967 &value)) { 967 &value)) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 AddToMaps(t_url); 1001 AddToMaps(t_url);
1002 something_changed = true; 1002 something_changed = true;
1003 } 1003 }
1004 } 1004 }
1005 1005
1006 if (something_changed && loaded_) { 1006 if (something_changed && loaded_) {
1007 FOR_EACH_OBSERVER(TemplateURLModelObserver, model_observers_, 1007 FOR_EACH_OBSERVER(TemplateURLModelObserver, model_observers_,
1008 OnTemplateURLModelChanged()); 1008 OnTemplateURLModelChanged());
1009 } 1009 }
1010 } 1010 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_unittest.cc ('k') | chrome/browser/search_engines/template_url_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698