| 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 "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2164 SavePageType save_type) { | 2164 SavePageType save_type) { |
| 2165 // Stop the page from navigating. | 2165 // Stop the page from navigating. |
| 2166 Stop(); | 2166 Stop(); |
| 2167 | 2167 |
| 2168 save_package_ = new SavePackage(this, save_type, main_file, dir_path); | 2168 save_package_ = new SavePackage(this, save_type, main_file, dir_path); |
| 2169 return save_package_->Init(SavePackageDownloadCreatedCallback()); | 2169 return save_package_->Init(SavePackageDownloadCreatedCallback()); |
| 2170 } | 2170 } |
| 2171 | 2171 |
| 2172 void WebContentsImpl::SaveFrame(const GURL& url, | 2172 void WebContentsImpl::SaveFrame(const GURL& url, |
| 2173 const Referrer& referrer) { | 2173 const Referrer& referrer) { |
| 2174 printf("WCI::SaveFrame, url = %s\n", |
| 2175 url.possibly_invalid_spec().c_str()); |
| 2176 |
| 2174 if (!GetURL().is_valid()) | 2177 if (!GetURL().is_valid()) |
| 2175 return; | 2178 return; |
| 2179 printf("is_valid\n"); |
| 2176 bool is_main_frame = (url == GetURL()); | 2180 bool is_main_frame = (url == GetURL()); |
| 2181 printf("is_main_frame: %d\n", is_main_frame); |
| 2177 | 2182 |
| 2178 DownloadManager* dlm = | 2183 DownloadManager* dlm = |
| 2179 BrowserContext::GetDownloadManager(GetBrowserContext()); | 2184 BrowserContext::GetDownloadManager(GetBrowserContext()); |
| 2185 printf("dlm = [%p]\n", dlm); |
| 2180 if (!dlm) | 2186 if (!dlm) |
| 2181 return; | 2187 return; |
| 2182 int64 post_id = -1; | 2188 int64 post_id = -1; |
| 2183 if (is_main_frame) { | 2189 if (is_main_frame) { |
| 2184 const NavigationEntry* entry = controller_.GetLastCommittedEntry(); | 2190 const NavigationEntry* entry = controller_.GetLastCommittedEntry(); |
| 2185 if (entry) | 2191 if (entry) |
| 2186 post_id = entry->GetPostID(); | 2192 post_id = entry->GetPostID(); |
| 2187 } | 2193 } |
| 2188 scoped_ptr<DownloadUrlParameters> params( | 2194 scoped_ptr<DownloadUrlParameters> params( |
| 2189 DownloadUrlParameters::FromWebContents(this, url)); | 2195 DownloadUrlParameters::FromWebContents(this, url)); |
| 2190 params->set_referrer(referrer); | 2196 params->set_referrer(referrer); |
| 2191 params->set_post_id(post_id); | 2197 params->set_post_id(post_id); |
| 2192 params->set_prefer_cache(true); | 2198 params->set_prefer_cache(true); |
| 2199 printf("post_id >= 0: %d\n", post_id >= 0); |
| 2193 if (post_id >= 0) | 2200 if (post_id >= 0) |
| 2194 params->set_method("POST"); | 2201 params->set_method("POST"); |
| 2195 params->set_prompt(true); | 2202 params->set_prompt(true); |
| 2196 dlm->DownloadUrl(params.Pass()); | 2203 dlm->DownloadUrl(params.Pass()); |
| 2197 } | 2204 } |
| 2198 | 2205 |
| 2199 void WebContentsImpl::GenerateMHTML( | 2206 void WebContentsImpl::GenerateMHTML( |
| 2200 const base::FilePath& file, | 2207 const base::FilePath& file, |
| 2201 const base::Callback<void(int64)>& callback) { | 2208 const base::Callback<void(int64)>& callback) { |
| 2202 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback); | 2209 MHTMLGenerationManager::GetInstance()->SaveMHTML(this, file, callback); |
| (...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4246 node->render_manager()->ResumeResponseDeferredAtStart(); | 4253 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4247 } | 4254 } |
| 4248 | 4255 |
| 4249 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4256 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4250 force_disable_overscroll_content_ = force_disable; | 4257 force_disable_overscroll_content_ = force_disable; |
| 4251 if (view_) | 4258 if (view_) |
| 4252 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4259 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4253 } | 4260 } |
| 4254 | 4261 |
| 4255 } // namespace content | 4262 } // namespace content |
| OLD | NEW |