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

Side by Side Diff: chrome/browser/prerender/prerender_manager.cc

Issue 8600004: Adding a fourth omnibox prerender experiment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
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/prerender/prerender_manager.h" 5 #include "chrome/browser/prerender/prerender_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 break; 342 break;
343 343
344 case OMNIBOX_HEURISTIC_CONSERVATIVE: 344 case OMNIBOX_HEURISTIC_CONSERVATIVE:
345 origin = ORIGIN_OMNIBOX_CONSERVATIVE; 345 origin = ORIGIN_OMNIBOX_CONSERVATIVE;
346 break; 346 break;
347 347
348 case OMNIBOX_HEURISTIC_EXACT: 348 case OMNIBOX_HEURISTIC_EXACT:
349 origin = ORIGIN_OMNIBOX_EXACT; 349 origin = ORIGIN_OMNIBOX_EXACT;
350 break; 350 break;
351 351
352 case OMNIBOX_HEURISTIC_EXACT_FULL:
353 origin = ORIGIN_OMNIBOX_EXACT_FULL;
354 break;
355
352 default: 356 default:
353 NOTREACHED(); 357 NOTREACHED();
354 break; 358 break;
355 }; 359 };
356 360
357 return AddPrerender(origin, std::make_pair(-1, -1), url, GURL(), 361 return AddPrerender(origin, std::make_pair(-1, -1), url, GURL(),
358 session_storage_namespace); 362 session_storage_namespace);
359 } 363 }
360 364
361 bool PrerenderManager::AddPrerender( 365 bool PrerenderManager::AddPrerender(
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 switch (GetOmniboxHeuristicToUse()) { 1061 switch (GetOmniboxHeuristicToUse()) {
1058 case OMNIBOX_HEURISTIC_ORIGINAL: 1062 case OMNIBOX_HEURISTIC_ORIGINAL:
1059 dict_value->SetString("omnibox_heuristic", "(original)"); 1063 dict_value->SetString("omnibox_heuristic", "(original)");
1060 break; 1064 break;
1061 case OMNIBOX_HEURISTIC_CONSERVATIVE: 1065 case OMNIBOX_HEURISTIC_CONSERVATIVE:
1062 dict_value->SetString("omnibox_heuristic", "(conservative)"); 1066 dict_value->SetString("omnibox_heuristic", "(conservative)");
1063 break; 1067 break;
1064 case OMNIBOX_HEURISTIC_EXACT: 1068 case OMNIBOX_HEURISTIC_EXACT:
1065 dict_value->SetString("omnibox_heuristic", "(exact)"); 1069 dict_value->SetString("omnibox_heuristic", "(exact)");
1066 break; 1070 break;
1071 case OMNIBOX_HEURISTIC_EXACT_FULL:
1072 dict_value->SetString("omnibox_heuristic", "(exact full)");
1073 break;
1067 default: 1074 default:
1068 NOTREACHED(); 1075 NOTREACHED();
1069 break; 1076 break;
1070 } 1077 }
1071 } 1078 }
1072 // If prerender is disabled via a flag this method is not even called. 1079 // If prerender is disabled via a flag this method is not even called.
1073 if (IsControlGroup()) 1080 if (IsControlGroup())
1074 dict_value->SetString("disabled_reason", "(Disabled for testing)"); 1081 dict_value->SetString("disabled_reason", "(Disabled for testing)");
1075 if (IsNoUseGroup()) 1082 if (IsNoUseGroup())
1076 dict_value->SetString("disabled_reason", "(Not using prerendered pages)"); 1083 dict_value->SetString("disabled_reason", "(Not using prerendered pages)");
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 if (!render_process_host || !render_process_host->browser_context()) 1150 if (!render_process_host || !render_process_host->browser_context())
1144 return NULL; 1151 return NULL;
1145 Profile* profile = Profile::FromBrowserContext( 1152 Profile* profile = Profile::FromBrowserContext(
1146 render_process_host->browser_context()); 1153 render_process_host->browser_context());
1147 if (!profile) 1154 if (!profile)
1148 return NULL; 1155 return NULL;
1149 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile); 1156 return PrerenderManagerFactory::GetInstance()->GetForProfile(profile);
1150 } 1157 }
1151 1158
1152 } // namespace prerender 1159 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698