OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/frame/browser_root_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/autocomplete/autocomplete.h" | 9 #include "chrome/browser/autocomplete/autocomplete.h" |
10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 10 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 GURL* url) { | 140 GURL* url) { |
141 if (!data.HasString()) | 141 if (!data.HasString()) |
142 return false; | 142 return false; |
143 | 143 |
144 std::wstring text; | 144 std::wstring text; |
145 if (!data.GetString(&text) || text.empty()) | 145 if (!data.GetString(&text) || text.empty()) |
146 return false; | 146 return false; |
147 | 147 |
148 AutocompleteMatch match; | 148 AutocompleteMatch match; |
149 browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify( | 149 browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify( |
150 text, std::wstring(), false, &match, NULL); | 150 WideToUTF16Hack(text), string16(), false, &match, NULL); |
151 if (!match.destination_url.is_valid()) | 151 if (!match.destination_url.is_valid()) |
152 return false; | 152 return false; |
153 | 153 |
154 if (url) | 154 if (url) |
155 *url = match.destination_url; | 155 *url = match.destination_url; |
156 return true; | 156 return true; |
157 } | 157 } |
OLD | NEW |