| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |