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

Side by Side Diff: components/omnibox/browser/search_provider.cc

Issue 2558913003: Restrict transmission of external exp ids to signed in users. (Closed)
Patch Set: google_services_account_id is not initialized in incognito Created 4 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "components/omnibox/browser/search_provider.h" 5 #include "components/omnibox/browser/search_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 LogOmniboxSuggestRequest(REQUEST_SENT); 883 LogOmniboxSuggestRequest(REQUEST_SENT);
884 884
885 std::unique_ptr<net::URLFetcher> fetcher = 885 std::unique_ptr<net::URLFetcher> fetcher =
886 net::URLFetcher::Create(id, suggest_url, net::URLFetcher::GET, this); 886 net::URLFetcher::Create(id, suggest_url, net::URLFetcher::GET, this);
887 data_use_measurement::DataUseUserData::AttachToFetcher( 887 data_use_measurement::DataUseUserData::AttachToFetcher(
888 fetcher.get(), data_use_measurement::DataUseUserData::OMNIBOX); 888 fetcher.get(), data_use_measurement::DataUseUserData::OMNIBOX);
889 fetcher->SetRequestContext(client()->GetRequestContext()); 889 fetcher->SetRequestContext(client()->GetRequestContext());
890 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES); 890 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
891 // Add Chrome experiment state to the request headers. 891 // Add Chrome experiment state to the request headers.
892 net::HttpRequestHeaders headers; 892 net::HttpRequestHeaders headers;
893 variations::AppendVariationHeaders( 893 variations::AppendVariationHeaders(fetcher->GetOriginalURL(),
894 fetcher->GetOriginalURL(), client()->IsOffTheRecord(), false, &headers); 894 client()->IsOffTheRecord(), false, false,
895 &headers);
895 fetcher->SetExtraRequestHeaders(headers.ToString()); 896 fetcher->SetExtraRequestHeaders(headers.ToString());
896 fetcher->Start(); 897 fetcher->Start();
897 return fetcher; 898 return fetcher;
898 } 899 }
899 900
900 void SearchProvider::ConvertResultsToAutocompleteMatches() { 901 void SearchProvider::ConvertResultsToAutocompleteMatches() {
901 // Convert all the results to matches and add them to a map, so we can keep 902 // Convert all the results to matches and add them to a map, so we can keep
902 // the most relevant match for each result. 903 // the most relevant match for each result.
903 base::TimeTicks start_time(base::TimeTicks::Now()); 904 base::TimeTicks start_time(base::TimeTicks::Now());
904 MatchMap map; 905 MatchMap map;
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) 1497 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i)
1497 matches.push_back(i->second); 1498 matches.push_back(i->second);
1498 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); 1499 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant);
1499 1500
1500 // If there is a top scoring entry, find the corresponding answer. 1501 // If there is a top scoring entry, find the corresponding answer.
1501 if (!matches.empty()) 1502 if (!matches.empty())
1502 return answers_cache_.GetTopAnswerEntry(matches[0].contents); 1503 return answers_cache_.GetTopAnswerEntry(matches[0].contents);
1503 1504
1504 return AnswersQueryData(); 1505 return AnswersQueryData();
1505 } 1506 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698