OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 WebContents* new_contents = WebContents::Create( | 1145 WebContents* new_contents = WebContents::Create( |
1146 tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 1146 tab_contents->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
1147 preview_contents_.reset(new TabContents(new_contents)); | 1147 preview_contents_.reset(new TabContents(new_contents)); |
1148 AddPreviewUsageForHistogram(template_url_id_, PREVIEW_CREATED, group_); | 1148 AddPreviewUsageForHistogram(template_url_id_, PREVIEW_CREATED, group_); |
1149 session_storage_namespace_ = GetSessionStorageNamespace(tab_contents); | 1149 session_storage_namespace_ = GetSessionStorageNamespace(tab_contents); |
1150 preview_tab_contents_delegate_.reset(new WebContentsDelegateImpl(this)); | 1150 preview_tab_contents_delegate_.reset(new WebContentsDelegateImpl(this)); |
1151 SetupPreviewContents(tab_contents); | 1151 SetupPreviewContents(tab_contents); |
1152 | 1152 |
1153 // TODO(beng): investigate if we can avoid this and instead rely on the | 1153 // TODO(beng): investigate if we can avoid this and instead rely on the |
1154 // visibility of the WebContentsView | 1154 // visibility of the WebContentsView |
1155 preview_contents_->web_contents()->WasRestored(); | 1155 preview_contents_->web_contents()->WasShown(); |
1156 } | 1156 } |
1157 | 1157 |
1158 void InstantLoader::LoadInstantURL(const TemplateURL* template_url, | 1158 void InstantLoader::LoadInstantURL(const TemplateURL* template_url, |
1159 content::PageTransition transition_type, | 1159 content::PageTransition transition_type, |
1160 const string16& user_text, | 1160 const string16& user_text, |
1161 bool verbatim, | 1161 bool verbatim, |
1162 bool override_user_agent) { | 1162 bool override_user_agent) { |
1163 preview_tab_contents_delegate_->PrepareForNewLoad(); | 1163 preview_tab_contents_delegate_->PrepareForNewLoad(); |
1164 | 1164 |
1165 // Load the instant URL. We don't reflect the url we load in url() as | 1165 // Load the instant URL. We don't reflect the url we load in url() as |
(...skipping 27 matching lines...) Expand all Loading... |
1193 host->Send(new ChromeViewMsg_SearchBoxResize( | 1193 host->Send(new ChromeViewMsg_SearchBoxResize( |
1194 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); | 1194 host->GetRoutingID(), GetOmniboxBoundsInTermsOfPreview())); |
1195 } else { | 1195 } else { |
1196 host->Send(new ChromeViewMsg_SearchBoxChange( | 1196 host->Send(new ChromeViewMsg_SearchBoxChange( |
1197 host->GetRoutingID(), user_text, verbatim, 0, 0)); | 1197 host->GetRoutingID(), user_text, verbatim, 0, 0)); |
1198 } | 1198 } |
1199 | 1199 |
1200 frame_load_observer_.reset(new FrameLoadObserver( | 1200 frame_load_observer_.reset(new FrameLoadObserver( |
1201 this, preview_contents()->web_contents(), user_text, verbatim)); | 1201 this, preview_contents()->web_contents(), user_text, verbatim)); |
1202 } | 1202 } |
OLD | NEW |