| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 AutocompleteMatch alternate_nav_match_; | 208 AutocompleteMatch alternate_nav_match_; |
| 209 | 209 |
| 210 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxClient); | 210 DISALLOW_COPY_AND_ASSIGN(TestingOmniboxClient); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 TestingOmniboxClient::TestingOmniboxClient() | 213 TestingOmniboxClient::TestingOmniboxClient() |
| 214 : autocomplete_classifier_( | 214 : autocomplete_classifier_( |
| 215 base::MakeUnique<AutocompleteController>( | 215 base::MakeUnique<AutocompleteController>( |
| 216 CreateAutocompleteProviderClient(), | 216 CreateAutocompleteProviderClient(), |
| 217 nullptr, | 217 nullptr, |
| 218 AutocompleteClassifier::kDefaultOmniboxProviders), | 218 AutocompleteClassifier::DefaultOmniboxProviders()), |
| 219 base::MakeUnique<TestingSchemeClassifier>()) {} | 219 base::MakeUnique<TestingSchemeClassifier>()) {} |
| 220 | 220 |
| 221 TestingOmniboxClient::~TestingOmniboxClient() { | 221 TestingOmniboxClient::~TestingOmniboxClient() { |
| 222 autocomplete_classifier_.Shutdown(); | 222 autocomplete_classifier_.Shutdown(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 std::unique_ptr<AutocompleteProviderClient> | 225 std::unique_ptr<AutocompleteProviderClient> |
| 226 TestingOmniboxClient::CreateAutocompleteProviderClient() { | 226 TestingOmniboxClient::CreateAutocompleteProviderClient() { |
| 227 std::unique_ptr<MockAutocompleteProviderClient> provider_client( | 227 std::unique_ptr<MockAutocompleteProviderClient> provider_client( |
| 228 new MockAutocompleteProviderClient()); | 228 new MockAutocompleteProviderClient()); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 alternate_nav_url, base::string16(), 0); | 382 alternate_nav_url, base::string16(), 0); |
| 383 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( | 383 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( |
| 384 client->alternate_nav_match().fill_into_edit)); | 384 client->alternate_nav_match().fill_into_edit)); |
| 385 | 385 |
| 386 model()->SetUserText(base::ASCIIToUTF16("abcd")); | 386 model()->SetUserText(base::ASCIIToUTF16("abcd")); |
| 387 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, | 387 model()->OpenMatch(match, WindowOpenDisposition::CURRENT_TAB, |
| 388 alternate_nav_url, base::string16(), 0); | 388 alternate_nav_url, base::string16(), 0); |
| 389 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( | 389 EXPECT_TRUE(AutocompleteInput::HasHTTPScheme( |
| 390 client->alternate_nav_match().fill_into_edit)); | 390 client->alternate_nav_match().fill_into_edit)); |
| 391 } | 391 } |
| OLD | NEW |