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 "chrome/browser/ui/omnibox/omnibox_controller.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_controller.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 8 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
9 #include "chrome/browser/autocomplete/autocomplete_match.h" | 9 #include "chrome/browser/autocomplete/autocomplete_match.h" |
10 #include "chrome/browser/autocomplete/search_provider.h" | 10 #include "chrome/browser/autocomplete/search_provider.h" |
11 #include "chrome/browser/net/predictor.h" | 11 #include "chrome/browser/net/predictor.h" |
12 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 12 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
13 #include "chrome/browser/prerender/prerender_field_trial.h" | 13 #include "chrome/browser/prerender/prerender_field_trial.h" |
14 #include "chrome/browser/prerender/prerender_manager.h" | 14 #include "chrome/browser/prerender/prerender_manager.h" |
15 #include "chrome/browser/prerender/prerender_manager_factory.h" | 15 #include "chrome/browser/prerender/prerender_manager_factory.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/search/search.h" | 17 #include "chrome/browser/search/search.h" |
18 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
19 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 19 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
20 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" | 20 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
21 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 21 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
22 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" | 22 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" |
23 #include "chrome/common/instant_types.h" | 23 #include "chrome/common/instant_types.h" |
| 24 #include "components/search/search.h" |
24 #include "extensions/common/constants.h" | 25 #include "extensions/common/constants.h" |
25 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 // Returns the AutocompleteMatch that the InstantController should prefetch, if | 30 // Returns the AutocompleteMatch that the InstantController should prefetch, if |
30 // any. | 31 // any. |
31 // | 32 // |
32 // The SearchProvider may mark some suggestions to be prefetched based on | 33 // The SearchProvider may mark some suggestions to be prefetched based on |
33 // instructions from the suggest server. If such a match ranks sufficiently | 34 // instructions from the suggest server. If such a match ranks sufficiently |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 if (profile_->GetNetworkPredictor()) { | 155 if (profile_->GetNetworkPredictor()) { |
155 profile_->GetNetworkPredictor()->AnticipateOmniboxUrl( | 156 profile_->GetNetworkPredictor()->AnticipateOmniboxUrl( |
156 match.destination_url, | 157 match.destination_url, |
157 predictors::AutocompleteActionPredictor::IsPreconnectable(match)); | 158 predictors::AutocompleteActionPredictor::IsPreconnectable(match)); |
158 } | 159 } |
159 // We could prefetch the alternate nav URL, if any, but because there | 160 // We could prefetch the alternate nav URL, if any, but because there |
160 // can be many of these as a user types an initial series of characters, | 161 // can be many of these as a user types an initial series of characters, |
161 // the OS DNS cache could suffer eviction problems for minimal gain. | 162 // the OS DNS cache could suffer eviction problems for minimal gain. |
162 } | 163 } |
163 } | 164 } |
OLD | NEW |