Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit.cc

Issue 7685009: Revert "Modifying prefetch to account for multi-profile." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/autocomplete/autocomplete_edit.h" 5 #include "chrome/browser/autocomplete/autocomplete_edit.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
16 #include "chrome/browser/autocomplete/autocomplete_match.h" 16 #include "chrome/browser/autocomplete/autocomplete_match.h"
17 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" 17 #include "chrome/browser/autocomplete/autocomplete_popup_model.h"
18 #include "chrome/browser/autocomplete/autocomplete_popup_view.h" 18 #include "chrome/browser/autocomplete/autocomplete_popup_view.h"
19 #include "chrome/browser/autocomplete/keyword_provider.h" 19 #include "chrome/browser/autocomplete/keyword_provider.h"
20 #include "chrome/browser/autocomplete/search_provider.h" 20 #include "chrome/browser/autocomplete/search_provider.h"
21 #include "chrome/browser/command_updater.h" 21 #include "chrome/browser/command_updater.h"
22 #include "chrome/browser/extensions/extension_omnibox_api.h" 22 #include "chrome/browser/extensions/extension_omnibox_api.h"
23 #include "chrome/browser/google/google_url_tracker.h" 23 #include "chrome/browser/google/google_url_tracker.h"
24 #include "chrome/browser/instant/instant_controller.h" 24 #include "chrome/browser/instant/instant_controller.h"
25 #include "chrome/browser/net/predictor.h" 25 #include "chrome/browser/net/predictor_api.h"
26 #include "chrome/browser/net/url_fixer_upper.h" 26 #include "chrome/browser/net/url_fixer_upper.h"
27 #include "chrome/browser/prerender/prerender_manager.h" 27 #include "chrome/browser/prerender/prerender_manager.h"
28 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
29 #include "chrome/browser/search_engines/template_url.h" 29 #include "chrome/browser/search_engines/template_url.h"
30 #include "chrome/browser/search_engines/template_url_service.h" 30 #include "chrome/browser/search_engines/template_url_service.h"
31 #include "chrome/browser/search_engines/template_url_service_factory.h" 31 #include "chrome/browser/search_engines/template_url_service_factory.h"
32 #include "chrome/browser/ui/browser_list.h" 32 #include "chrome/browser/ui/browser_list.h"
33 #include "chrome/browser/ui/omnibox/omnibox_view.h" 33 #include "chrome/browser/ui/omnibox/omnibox_view.h"
34 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 34 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
35 #include "chrome/common/chrome_notification_types.h" 35 #include "chrome/common/chrome_notification_types.h"
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 TabContentsWrapper* tab = controller_->GetTabContentsWrapper(); 1076 TabContentsWrapper* tab = controller_->GetTabContentsWrapper();
1077 prerender::PrerenderManager* prerender_manager = 1077 prerender::PrerenderManager* prerender_manager =
1078 tab->profile()->GetPrerenderManager(); 1078 tab->profile()->GetPrerenderManager();
1079 if (prerender_manager) 1079 if (prerender_manager)
1080 prerender_manager->AddPrerenderFromOmnibox(match.destination_url); 1080 prerender_manager->AddPrerenderFromOmnibox(match.destination_url);
1081 } 1081 }
1082 1082
1083 void AutocompleteEditModel::DoPreconnect(const AutocompleteMatch& match) { 1083 void AutocompleteEditModel::DoPreconnect(const AutocompleteMatch& match) {
1084 if (!match.destination_url.SchemeIs(chrome::kExtensionScheme)) { 1084 if (!match.destination_url.SchemeIs(chrome::kExtensionScheme)) {
1085 // Warm up DNS Prefetch cache, or preconnect to a search service. 1085 // Warm up DNS Prefetch cache, or preconnect to a search service.
1086 if (profile_->GetNetworkPredictor()) { 1086 chrome_browser_net::AnticipateOmniboxUrl(match.destination_url,
1087 profile_->GetNetworkPredictor()->AnticipateOmniboxUrl( 1087 IsPreconnectable(match.type));
1088 match.destination_url,
1089 IsPreconnectable(match.type));
1090 }
1091 // We could prefetch the alternate nav URL, if any, but because there 1088 // We could prefetch the alternate nav URL, if any, but because there
1092 // can be many of these as a user types an initial series of characters, 1089 // can be many of these as a user types an initial series of characters,
1093 // the OS DNS cache could suffer eviction problems for minimal gain. 1090 // the OS DNS cache could suffer eviction problems for minimal gain.
1094 } 1091 }
1095 } 1092 }
1096 1093
1097 // static 1094 // static
1098 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) { 1095 bool AutocompleteEditModel::IsSpaceCharForAcceptingKeyword(wchar_t c) {
1099 switch (c) { 1096 switch (c) {
1100 case 0x0020: // Space 1097 case 0x0020: // Space
1101 case 0x3000: // Ideographic Space 1098 case 0x3000: // Ideographic Space
1102 return true; 1099 return true;
1103 default: 1100 default:
1104 return false; 1101 return false;
1105 } 1102 }
1106 } 1103 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698