| 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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 // Used in automated testing to bypass prompting the user for file names. | 1198 // Used in automated testing to bypass prompting the user for file names. |
| 1199 // Instead, the names and paths are hard coded rather than running them through | 1199 // Instead, the names and paths are hard coded rather than running them through |
| 1200 // file name sanitation and extension / mime checking. | 1200 // file name sanitation and extension / mime checking. |
| 1201 bool WebContentsImpl::SavePage(const FilePath& main_file, | 1201 bool WebContentsImpl::SavePage(const FilePath& main_file, |
| 1202 const FilePath& dir_path, | 1202 const FilePath& dir_path, |
| 1203 content::SavePageType save_type) { | 1203 content::SavePageType save_type) { |
| 1204 // Stop the page from navigating. | 1204 // Stop the page from navigating. |
| 1205 Stop(); | 1205 Stop(); |
| 1206 | 1206 |
| 1207 save_package_ = new SavePackage(this, save_type, main_file, dir_path); | 1207 save_package_ = new SavePackage(this, save_type, main_file, dir_path); |
| 1208 return save_package_->Init(); | 1208 return save_package_->Init(content::SavePackageDownloadCreatedCallback()); |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 void WebContentsImpl::GenerateMHTML( | 1211 void WebContentsImpl::GenerateMHTML( |
| 1212 const FilePath& file, | 1212 const FilePath& file, |
| 1213 const base::Callback<void(const FilePath&, int64)>& callback) { | 1213 const base::Callback<void(const FilePath&, int64)>& callback) { |
| 1214 MHTMLGenerationManager::GetInstance()->GenerateMHTML(this, file, callback); | 1214 MHTMLGenerationManager::GetInstance()->GenerateMHTML(this, file, callback); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 bool WebContentsImpl::IsActiveEntry(int32 page_id) { | 1217 bool WebContentsImpl::IsActiveEntry(int32 page_id) { |
| 1218 NavigationEntryImpl* active_entry = | 1218 NavigationEntryImpl* active_entry = |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2638 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2638 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2639 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2639 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2640 // Can be NULL during tests. | 2640 // Can be NULL during tests. |
| 2641 if (rwh_view) | 2641 if (rwh_view) |
| 2642 rwh_view->SetSize(GetView()->GetContainerSize()); | 2642 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2643 } | 2643 } |
| 2644 | 2644 |
| 2645 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2645 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2646 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2646 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2647 } | 2647 } |
| OLD | NEW |