| 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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 // Used in automated testing to bypass prompting the user for file names. | 1186 // Used in automated testing to bypass prompting the user for file names. |
| 1187 // Instead, the names and paths are hard coded rather than running them through | 1187 // Instead, the names and paths are hard coded rather than running them through |
| 1188 // file name sanitation and extension / mime checking. | 1188 // file name sanitation and extension / mime checking. |
| 1189 bool WebContentsImpl::SavePage(const FilePath& main_file, | 1189 bool WebContentsImpl::SavePage(const FilePath& main_file, |
| 1190 const FilePath& dir_path, | 1190 const FilePath& dir_path, |
| 1191 content::SavePageType save_type) { | 1191 content::SavePageType save_type) { |
| 1192 // Stop the page from navigating. | 1192 // Stop the page from navigating. |
| 1193 Stop(); | 1193 Stop(); |
| 1194 | 1194 |
| 1195 save_package_ = new SavePackage(this, save_type, main_file, dir_path); | 1195 save_package_ = new SavePackage(this, save_type, main_file, dir_path); |
| 1196 return save_package_->Init(); | 1196 return save_package_->Init(content::SaveFileDownloadCreatedCallback()); |
| 1197 } | 1197 } |
| 1198 | 1198 |
| 1199 void WebContentsImpl::GenerateMHTML( | 1199 void WebContentsImpl::GenerateMHTML( |
| 1200 const FilePath& file, | 1200 const FilePath& file, |
| 1201 const base::Callback<void(const FilePath&, int64)>& callback) { | 1201 const base::Callback<void(const FilePath&, int64)>& callback) { |
| 1202 MHTMLGenerationManager::GetInstance()->GenerateMHTML(this, file, callback); | 1202 MHTMLGenerationManager::GetInstance()->GenerateMHTML(this, file, callback); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 bool WebContentsImpl::IsActiveEntry(int32 page_id) { | 1205 bool WebContentsImpl::IsActiveEntry(int32 page_id) { |
| 1206 NavigationEntryImpl* active_entry = | 1206 NavigationEntryImpl* active_entry = |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2626 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2626 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2627 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2627 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2628 // Can be NULL during tests. | 2628 // Can be NULL during tests. |
| 2629 if (rwh_view) | 2629 if (rwh_view) |
| 2630 rwh_view->SetSize(GetView()->GetContainerSize()); | 2630 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2631 } | 2631 } |
| 2632 | 2632 |
| 2633 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2633 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2634 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2634 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2635 } | 2635 } |
| OLD | NEW |