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

Side by Side Diff: chrome/browser/instant/instant_loader.cc

Issue 7558014: Add a URL param to indicate group selection in Instant field trial. (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
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/instant/instant_loader.h" 5 #include "chrome/browser/instant/instant_loader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 1014
1015 // Load the instant URL. We don't reflect the url we load in url() as 1015 // Load the instant URL. We don't reflect the url we load in url() as
1016 // callers expect that we're loading the URL they tell us to. 1016 // callers expect that we're loading the URL they tell us to.
1017 // 1017 //
1018 // This uses an empty string for the replacement text as the url doesn't 1018 // This uses an empty string for the replacement text as the url doesn't
1019 // really have the search params, but we need to use the replace 1019 // really have the search params, but we need to use the replace
1020 // functionality so that embeded tags (like {google:baseURL}) are escaped 1020 // functionality so that embeded tags (like {google:baseURL}) are escaped
1021 // correctly. 1021 // correctly.
1022 // TODO(sky): having to use a replaceable url is a bit of a hack here. 1022 // TODO(sky): having to use a replaceable url is a bit of a hack here.
1023 GURL instant_url(template_url->instant_url()->ReplaceSearchTerms( 1023 GURL instant_url(template_url->instant_url()->ReplaceSearchTerms(
1024 *template_url, string16(), -1, string16())); 1024 tab_contents->profile(), *template_url, string16(), -1, string16()));
1025 CommandLine* cl = CommandLine::ForCurrentProcess(); 1025 CommandLine* cl = CommandLine::ForCurrentProcess();
1026 if (cl->HasSwitch(switches::kInstantURL)) 1026 if (cl->HasSwitch(switches::kInstantURL))
1027 instant_url = GURL(cl->GetSwitchValueASCII(switches::kInstantURL)); 1027 instant_url = GURL(cl->GetSwitchValueASCII(switches::kInstantURL));
1028 preview_contents_->controller().LoadURL(instant_url, GURL(), transition_type); 1028 preview_contents_->controller().LoadURL(instant_url, GURL(), transition_type);
1029 RenderViewHost* host = preview_contents_->render_view_host(); 1029 RenderViewHost* host = preview_contents_->render_view_host();
1030 host->Send(new ViewMsg_SearchBoxChange( 1030 host->Send(new ViewMsg_SearchBoxChange(
1031 host->routing_id(), user_text, verbatim, 0, 0)); 1031 host->routing_id(), user_text, verbatim, 0, 0));
1032 frame_load_observer_.reset(new FrameLoadObserver( 1032 frame_load_observer_.reset(new FrameLoadObserver(
1033 this, preview_contents()->tab_contents(), user_text, verbatim)); 1033 this, preview_contents()->tab_contents(), user_text, verbatim));
1034 } 1034 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698