OLD | NEW |
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/ui/webui/omnibox/omnibox_ui_handler.h" | 5 #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 result->results_by_provider = | 145 result->results_by_provider = |
146 mojo::Array<AutocompleteResultsForProviderMojoPtr>::From( | 146 mojo::Array<AutocompleteResultsForProviderMojoPtr>::From( |
147 controller_->providers()); | 147 controller_->providers()); |
148 | 148 |
149 // Fill AutocompleteMatchMojo::starred. | 149 // Fill AutocompleteMatchMojo::starred. |
150 BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile_); | 150 BookmarkModel* bookmark_model = BookmarkModelFactory::GetForProfile(profile_); |
151 if (bookmark_model) { | 151 if (bookmark_model) { |
152 for (size_t i = 0; i < result->combined_results.size(); ++i) { | 152 for (size_t i = 0; i < result->combined_results.size(); ++i) { |
153 result->combined_results[i]->starred = bookmark_model->IsBookmarked( | 153 result->combined_results[i]->starred = bookmark_model->IsBookmarked( |
154 GURL(result->combined_results[i]->destination_url)); | 154 GURL(result->combined_results[i]->destination_url.get())); |
155 } | 155 } |
156 for (size_t i = 0; i < result->results_by_provider.size(); ++i) { | 156 for (size_t i = 0; i < result->results_by_provider.size(); ++i) { |
157 const AutocompleteResultsForProviderMojo& result_by_provider = | 157 const AutocompleteResultsForProviderMojo& result_by_provider = |
158 *result->results_by_provider[i]; | 158 *result->results_by_provider[i]; |
159 for (size_t j = 0; j < result_by_provider.results.size(); ++j) { | 159 for (size_t j = 0; j < result_by_provider.results.size(); ++j) { |
160 result_by_provider.results[j]->starred = bookmark_model->IsBookmarked( | 160 result_by_provider.results[j]->starred = bookmark_model->IsBookmarked( |
161 GURL(result_by_provider.results[j]->destination_url)); | 161 GURL(result_by_provider.results[j]->destination_url.get())); |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 page_->HandleNewAutocompleteResult(std::move(result)); | 166 page_->HandleNewAutocompleteResult(std::move(result)); |
167 } | 167 } |
168 | 168 |
169 bool OmniboxUIHandler::LookupIsTypedHost(const base::string16& host, | 169 bool OmniboxUIHandler::LookupIsTypedHost(const base::string16& host, |
170 bool* is_typed_host) const { | 170 bool* is_typed_host) const { |
171 history::HistoryService* const history_service = | 171 history::HistoryService* const history_service = |
(...skipping 29 matching lines...) Expand all Loading... |
201 prevent_inline_autocomplete, prefer_keyword, true, true, false, | 201 prevent_inline_autocomplete, prefer_keyword, true, true, false, |
202 ChromeAutocompleteSchemeClassifier(profile_)); | 202 ChromeAutocompleteSchemeClassifier(profile_)); |
203 controller_->Start(input_); | 203 controller_->Start(input_); |
204 } | 204 } |
205 | 205 |
206 void OmniboxUIHandler::ResetController() { | 206 void OmniboxUIHandler::ResetController() { |
207 controller_.reset(new AutocompleteController( | 207 controller_.reset(new AutocompleteController( |
208 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile_)), this, | 208 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile_)), this, |
209 AutocompleteClassifier::kDefaultOmniboxProviders)); | 209 AutocompleteClassifier::kDefaultOmniboxProviders)); |
210 } | 210 } |
OLD | NEW |