| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/content_settings/tab_specific_content_settings.h" | 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 10 #include "chrome/browser/history/history_tab_helper.h" | 10 #include "chrome/browser/history/history_tab_helper.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 instant_url_ = instant_url; | 59 instant_url_ = instant_url; |
| 60 on_stale_callback_ = on_stale_callback; | 60 on_stale_callback_ = on_stale_callback; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void InstantLoader::Load() { | 63 void InstantLoader::Load() { |
| 64 DVLOG(1) << "LoadURL: " << instant_url_; | 64 DVLOG(1) << "LoadURL: " << instant_url_; |
| 65 contents_->GetController().LoadURL( | 65 contents_->GetController().LoadURL( |
| 66 instant_url_, content::Referrer(), | 66 instant_url_, content::Referrer(), |
| 67 content::PAGE_TRANSITION_GENERATED, kInstantHeader); | 67 content::PAGE_TRANSITION_GENERATED, kInstantHeader); |
| 68 contents_->WasHidden(); | 68 contents_->WasHidden(); |
| 69 const content::NavigationEntry* entry = |
| 70 contents_->GetController().GetVisibleEntry(); |
| 71 base_navigation_entry_.reset(content::NavigationEntry::Create(*entry)); |
| 69 stale_page_timer_.Start( | 72 stale_page_timer_.Start( |
| 70 FROM_HERE, | 73 FROM_HERE, |
| 71 base::TimeDelta::FromMilliseconds(kStalePageTimeoutMS), | 74 base::TimeDelta::FromMilliseconds(kStalePageTimeoutMS), |
| 72 on_stale_callback_); | 75 on_stale_callback_); |
| 73 } | 76 } |
| 74 | 77 |
| 75 void InstantLoader::SetContents(scoped_ptr<content::WebContents> new_contents) { | 78 void InstantLoader::SetContents(scoped_ptr<content::WebContents> new_contents) { |
| 76 contents_.reset(new_contents.release()); | 79 contents_.reset(new_contents.release()); |
| 77 contents_->SetDelegate(this); | 80 contents_->SetDelegate(this); |
| 78 | 81 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 216 |
| 214 bool InstantLoader::OnGoToEntryOffset(int /* offset */) { | 217 bool InstantLoader::OnGoToEntryOffset(int /* offset */) { |
| 215 return false; | 218 return false; |
| 216 } | 219 } |
| 217 | 220 |
| 218 content::WebContents* InstantLoader::OpenURLFromTab( | 221 content::WebContents* InstantLoader::OpenURLFromTab( |
| 219 content::WebContents* source, | 222 content::WebContents* source, |
| 220 const content::OpenURLParams& params) { | 223 const content::OpenURLParams& params) { |
| 221 return delegate_->OpenURLFromTab(source, params); | 224 return delegate_->OpenURLFromTab(source, params); |
| 222 } | 225 } |
| OLD | NEW |