| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" | 10 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class TestOmniboxClient : public OmniboxClient { | 22 class TestOmniboxClient : public OmniboxClient { |
| 23 public: | 23 public: |
| 24 explicit TestOmniboxClient(Profile* profile) | 24 explicit TestOmniboxClient(Profile* profile) |
| 25 : profile_(profile), | 25 : profile_(profile), |
| 26 scheme_classifier_(profile) {} | 26 scheme_classifier_(profile) {} |
| 27 ~TestOmniboxClient() override {} | 27 ~TestOmniboxClient() override {} |
| 28 | 28 |
| 29 // OmniboxClient: | 29 // OmniboxClient: |
| 30 std::unique_ptr<AutocompleteProviderClient> CreateAutocompleteProviderClient() | 30 std::unique_ptr<AutocompleteProviderClient> CreateAutocompleteProviderClient() |
| 31 override { | 31 override { |
| 32 return base::WrapUnique(new ChromeAutocompleteProviderClient(profile_)); | 32 return base::MakeUnique<ChromeAutocompleteProviderClient>(profile_); |
| 33 } | 33 } |
| 34 std::unique_ptr<OmniboxNavigationObserver> CreateOmniboxNavigationObserver( | 34 std::unique_ptr<OmniboxNavigationObserver> CreateOmniboxNavigationObserver( |
| 35 const base::string16& text, | 35 const base::string16& text, |
| 36 const AutocompleteMatch& match, | 36 const AutocompleteMatch& match, |
| 37 const AutocompleteMatch& alternate_nav_match) override { | 37 const AutocompleteMatch& alternate_nav_match) override { |
| 38 return nullptr; | 38 return nullptr; |
| 39 } | 39 } |
| 40 bool CurrentPageExists() const override { return true; } | 40 bool CurrentPageExists() const override { return true; } |
| 41 const GURL& GetURL() const override { return GURL::EmptyGURL(); } | 41 const GURL& GetURL() const override { return GURL::EmptyGURL(); } |
| 42 const base::string16& GetTitle() const override { | 42 const base::string16& GetTitle() const override { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Ensure we have at least one provider. | 173 // Ensure we have at least one provider. |
| 174 ASSERT_NE(0, observed_providers); | 174 ASSERT_NE(0, observed_providers); |
| 175 | 175 |
| 176 // Ensure instant extended includes all the provides in classic Chrome. | 176 // Ensure instant extended includes all the provides in classic Chrome. |
| 177 int providers_with_instant_extended = observed_providers; | 177 int providers_with_instant_extended = observed_providers; |
| 178 // TODO(beaudoin): remove TYPE_SEARCH once it's no longer needed to pass | 178 // TODO(beaudoin): remove TYPE_SEARCH once it's no longer needed to pass |
| 179 // the Instant suggestion through via FinalizeInstantQuery. | 179 // the Instant suggestion through via FinalizeInstantQuery. |
| 180 CreateController(); | 180 CreateController(); |
| 181 AssertProviders(providers_with_instant_extended); | 181 AssertProviders(providers_with_instant_extended); |
| 182 } | 182 } |
| OLD | NEW |