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

Side by Side Diff: chrome/browser/android/vr_shell/vr_omnibox.cc

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Change the place where the title is added and some suggested renaming. Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/android/vr_shell/vr_omnibox.h" 5 #include "chrome/browser/android/vr_shell/vr_omnibox.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 26 matching lines...) Expand all
37 std::string desired_tld; 37 std::string desired_tld;
38 metrics::OmniboxEventProto::PageClassification page_classification = 38 metrics::OmniboxEventProto::PageClassification page_classification =
39 metrics::OmniboxEventProto::OTHER; 39 metrics::OmniboxEventProto::OTHER;
40 bool prevent_inline_autocomplete = false; 40 bool prevent_inline_autocomplete = false;
41 bool prefer_keyword = false; 41 bool prefer_keyword = false;
42 bool allow_exact_keyword_match = false; 42 bool allow_exact_keyword_match = false;
43 bool want_asynchronous_matches = true; 43 bool want_asynchronous_matches = true;
44 bool from_omnibox_focus = false; 44 bool from_omnibox_focus = false;
45 45
46 autocomplete_controller_->Start(AutocompleteInput( 46 autocomplete_controller_->Start(AutocompleteInput(
47 text, cursor_pos, desired_tld, current_url, page_classification, 47 text, cursor_pos, desired_tld, current_url, base::string16(),
Mark P 2017/04/12 05:07:56 Following the conventions of this outline-like fil
gcomanici 2017/04/12 16:16:30 Done.
48 prevent_inline_autocomplete, prefer_keyword, allow_exact_keyword_match, 48 page_classification, prevent_inline_autocomplete, prefer_keyword,
49 want_asynchronous_matches, from_omnibox_focus, 49 allow_exact_keyword_match, want_asynchronous_matches, from_omnibox_focus,
50 ChromeAutocompleteSchemeClassifier(profile_))); 50 ChromeAutocompleteSchemeClassifier(profile_)));
51 } 51 }
52 52
53 void VrOmnibox::OnResultChanged(bool default_match_changed) { 53 void VrOmnibox::OnResultChanged(bool default_match_changed) {
54 const AutocompleteResult& result = autocomplete_controller_->result(); 54 const AutocompleteResult& result = autocomplete_controller_->result();
55 auto suggestions = base::MakeUnique<base::ListValue>(); 55 auto suggestions = base::MakeUnique<base::ListValue>();
56 56
57 for (const AutocompleteMatch& match : result) { 57 for (const AutocompleteMatch& match : result) {
58 auto entry = base::MakeUnique<base::DictionaryValue>(); 58 auto entry = base::MakeUnique<base::DictionaryValue>();
59 entry->SetString("description", match.contents); 59 entry->SetString("description", match.contents);
60 entry->SetString("url", match.destination_url.spec()); 60 entry->SetString("url", match.destination_url.spec());
61 suggestions->Append(std::move(entry)); 61 suggestions->Append(std::move(entry));
62 } 62 }
63 63
64 ui_->SetOmniboxSuggestions(std::move(suggestions)); 64 ui_->SetOmniboxSuggestions(std::move(suggestions));
65 } 65 }
66 66
67 } // namespace vr_shell 67 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698