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/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 ViewMsg_Navigate_Params params; | 186 ViewMsg_Navigate_Params params; |
187 params.page_id = -1; | 187 params.page_id = -1; |
188 params.pending_history_list_offset = -1; | 188 params.pending_history_list_offset = -1; |
189 params.current_history_list_offset = -1; | 189 params.current_history_list_offset = -1; |
190 params.current_history_list_length = 0; | 190 params.current_history_list_length = 0; |
191 params.url = prerender_url_; | 191 params.url = prerender_url_; |
192 params.transition = PageTransition::LINK; | 192 params.transition = PageTransition::LINK; |
193 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; | 193 params.navigation_type = ViewMsg_Navigate_Type::NORMAL; |
194 params.referrer = referrer_; | 194 params.referrer = referrer_; |
195 params.request_time = base::Time::Now(); | 195 params.request_time = base::Time::Now(); |
196 params.is_hidden = true; | |
196 | 197 |
197 render_view_host_->Navigate(params); | 198 render_view_host_->Navigate(params); |
198 } | 199 } |
199 | 200 |
200 void PrerenderContents::StartPrerendering( | 201 void PrerenderContents::StartPrerendering( |
201 const RenderViewHost* source_render_view_host) { | 202 const RenderViewHost* source_render_view_host) { |
202 if (!UseTabContents()) { | 203 if (!UseTabContents()) { |
203 VLOG(1) << "Starting prerendering with LEGACY code"; | 204 VLOG(1) << "Starting prerendering with LEGACY code"; |
204 StartPrerenderingOld(source_render_view_host); | 205 StartPrerenderingOld(source_render_view_host); |
205 return; | 206 return; |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 Destroy(FINAL_STATUS_CLOSED); | 553 Destroy(FINAL_STATUS_CLOSED); |
553 } | 554 } |
554 | 555 |
555 RendererPreferences PrerenderContents::GetRendererPrefs( | 556 RendererPreferences PrerenderContents::GetRendererPrefs( |
556 Profile* profile) const { | 557 Profile* profile) const { |
557 RendererPreferences preferences; | 558 RendererPreferences preferences; |
558 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); | 559 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); |
559 return preferences; | 560 return preferences; |
560 } | 561 } |
561 | 562 |
563 bool PrerenderContents::IsHidden() const { | |
564 // Always in a hidden state, | |
brettw
2011/05/18 22:11:38
comma -> period.
Shishir
2011/05/20 03:48:19
Done.
| |
565 return true; | |
566 } | |
567 | |
562 WebPreferences PrerenderContents::GetWebkitPrefs() { | 568 WebPreferences PrerenderContents::GetWebkitPrefs() { |
563 return RenderViewHostDelegateHelper::GetWebkitPrefs(profile_, | 569 return RenderViewHostDelegateHelper::GetWebkitPrefs(profile_, |
564 false); // is_web_ui | 570 false); // is_web_ui |
565 } | 571 } |
566 | 572 |
567 void PrerenderContents::CreateNewWindow( | 573 void PrerenderContents::CreateNewWindow( |
568 int route_id, | 574 int route_id, |
569 const ViewHostMsg_CreateWindow_Params& params) { | 575 const ViewHostMsg_CreateWindow_Params& params) { |
570 // TODO(dominich): Remove when we switch to TabContents. | 576 // TODO(dominich): Remove when we switch to TabContents. |
571 // Since we don't want to permit child windows that would have a | 577 // Since we don't want to permit child windows that would have a |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
759 // used. | 765 // used. |
760 if (UseTabContents()) { | 766 if (UseTabContents()) { |
761 if (!prerender_contents_.get()) | 767 if (!prerender_contents_.get()) |
762 return NULL; | 768 return NULL; |
763 return prerender_contents_->render_view_host(); | 769 return prerender_contents_->render_view_host(); |
764 } | 770 } |
765 return render_view_host_; | 771 return render_view_host_; |
766 } | 772 } |
767 | 773 |
768 } // namespace prerender | 774 } // namespace prerender |
OLD | NEW |