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

Side by Side Diff: chrome/browser/ui/search/instant_controller.cc

Issue 15517007: Change InstantAutocompleteResult::Type to be AutocompleteMatchType::Type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 7 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/ui/search/instant_controller.h" 5 #include "chrome/browser/ui/search/instant_controller.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 // TODO(dcblack): Remove extraneous history entry caused by 404s. 1813 // TODO(dcblack): Remove extraneous history entry caused by 404s.
1814 // Note that the base case of a 204 being returned doesn't push a history 1814 // Note that the base case of a 204 being returned doesn't push a history
1815 // entry. 1815 // entry.
1816 } 1816 }
1817 1817
1818 void InstantController::PopulateInstantAutocompleteResultFromMatch( 1818 void InstantController::PopulateInstantAutocompleteResultFromMatch(
1819 const AutocompleteMatch& match, size_t autocomplete_match_index, 1819 const AutocompleteMatch& match, size_t autocomplete_match_index,
1820 InstantAutocompleteResult* result) { 1820 InstantAutocompleteResult* result) {
1821 DCHECK(result); 1821 DCHECK(result);
1822 result->provider = UTF8ToUTF16(match.provider->GetName()); 1822 result->provider = UTF8ToUTF16(match.provider->GetName());
1823 result->type = UTF8ToUTF16(AutocompleteMatchType::ToString(match.type)); 1823 result->type = match.type;
1824 result->description = match.description; 1824 result->description = match.description;
1825 result->destination_url = UTF8ToUTF16(match.destination_url.spec()); 1825 result->destination_url = UTF8ToUTF16(match.destination_url.spec());
1826 1826
1827 // Setting the search_query field tells the Instant page to treat the 1827 // Setting the search_query field tells the Instant page to treat the
1828 // suggestion as a query. 1828 // suggestion as a query.
1829 if (AutocompleteMatch::IsSearchType(match.type)) 1829 if (AutocompleteMatch::IsSearchType(match.type))
1830 result->search_query = match.contents; 1830 result->search_query = match.contents;
1831 1831
1832 result->transition = match.transition; 1832 result->transition = match.transition;
1833 result->relevance = match.relevance; 1833 result->relevance = match.relevance;
1834 result->autocomplete_match_index = autocomplete_match_index; 1834 result->autocomplete_match_index = autocomplete_match_index;
1835 1835
1836 DVLOG(1) << " " << result->relevance << " " << result->type << " " 1836 DVLOG(1) << " " << result->relevance << " " << result->type << " "
samarth 2013/05/23 21:09:38 Please use the string value in the output for read
kmadhusu 2013/05/23 21:53:22 Done.
1837 << result->provider << " " << result->destination_url << " '" 1837 << result->provider << " " << result->destination_url << " '"
1838 << result->description << "' '" << result->search_query << "' " 1838 << result->description << "' '" << result->search_query << "' "
1839 << result->transition << " " << result->autocomplete_match_index; 1839 << result->transition << " " << result->autocomplete_match_index;
1840 } 1840 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698