OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/omnibox/browser/search_provider.h" | 5 #include "components/omnibox/browser/search_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 19 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
20 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" | 20 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" |
21 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" | 21 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" |
22 #include "chrome/browser/history/history_service_factory.h" | 22 #include "chrome/browser/history/history_service_factory.h" |
23 #include "chrome/browser/search_engines/template_url_service_factory.h" | 23 #include "chrome/browser/search_engines/template_url_service_factory.h" |
24 #include "chrome/browser/signin/account_tracker_service_factory.h" | 24 #include "chrome/browser/signin/account_tracker_service_factory.h" |
25 #include "chrome/browser/signin/signin_manager_factory.h" | 25 #include "chrome/browser/signin/signin_manager_factory.h" |
26 #include "chrome/browser/sync/profile_sync_service.h" | |
27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 26 #include "chrome/browser/sync/profile_sync_service_factory.h" |
28 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
30 #include "chrome/test/base/testing_browser_process.h" | 29 #include "chrome/test/base/testing_browser_process.h" |
31 #include "chrome/test/base/testing_profile.h" | 30 #include "chrome/test/base/testing_profile.h" |
32 #include "components/bookmarks/common/bookmark_pref_names.h" | 31 #include "components/bookmarks/common/bookmark_pref_names.h" |
| 32 #include "components/browser_sync/browser/profile_sync_service.h" |
33 #include "components/google/core/browser/google_switches.h" | 33 #include "components/google/core/browser/google_switches.h" |
34 #include "components/history/core/browser/history_service.h" | 34 #include "components/history/core/browser/history_service.h" |
35 #include "components/metrics/proto/omnibox_event.pb.h" | 35 #include "components/metrics/proto/omnibox_event.pb.h" |
36 #include "components/omnibox/browser/autocomplete_controller.h" | 36 #include "components/omnibox/browser/autocomplete_controller.h" |
37 #include "components/omnibox/browser/autocomplete_input.h" | 37 #include "components/omnibox/browser/autocomplete_input.h" |
38 #include "components/omnibox/browser/autocomplete_match.h" | 38 #include "components/omnibox/browser/autocomplete_match.h" |
39 #include "components/omnibox/browser/autocomplete_provider.h" | 39 #include "components/omnibox/browser/autocomplete_provider.h" |
40 #include "components/omnibox/browser/autocomplete_provider_listener.h" | 40 #include "components/omnibox/browser/autocomplete_provider_listener.h" |
41 #include "components/omnibox/browser/history_url_provider.h" | 41 #include "components/omnibox/browser/history_url_provider.h" |
42 #include "components/omnibox/browser/omnibox_field_trial.h" | 42 #include "components/omnibox/browser/omnibox_field_trial.h" |
(...skipping 3530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3573 } | 3573 } |
3574 | 3574 |
3575 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { | 3575 TEST_F(SearchProviderTest, DoesNotProvideOnFocus) { |
3576 AutocompleteInput input( | 3576 AutocompleteInput input( |
3577 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), | 3577 base::ASCIIToUTF16("f"), base::string16::npos, std::string(), GURL(), |
3578 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, | 3578 metrics::OmniboxEventProto::INVALID_SPEC, false, true, true, true, true, |
3579 ChromeAutocompleteSchemeClassifier(&profile_)); | 3579 ChromeAutocompleteSchemeClassifier(&profile_)); |
3580 provider_->Start(input, false); | 3580 provider_->Start(input, false); |
3581 EXPECT_TRUE(provider_->matches().empty()); | 3581 EXPECT_TRUE(provider_->matches().empty()); |
3582 } | 3582 } |
OLD | NEW |