Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Side by Side Diff: chrome/browser/download/save_package.cc

Issue 6374009: Get rid of a few more interfaces from RenderViewHostDelegate that aren't need... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/download/save_package.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/download/save_package.h" 5 #include "chrome/browser/download/save_package.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 26 matching lines...) Expand all
37 #include "chrome/browser/renderer_host/render_view_host.h" 37 #include "chrome/browser/renderer_host/render_view_host.h"
38 #include "chrome/browser/renderer_host/render_view_host_delegate.h" 38 #include "chrome/browser/renderer_host/render_view_host_delegate.h"
39 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" 39 #include "chrome/browser/renderer_host/resource_dispatcher_host.h"
40 #include "chrome/browser/tab_contents/tab_contents.h" 40 #include "chrome/browser/tab_contents/tab_contents.h"
41 #include "chrome/browser/tab_contents/tab_util.h" 41 #include "chrome/browser/tab_contents/tab_util.h"
42 #include "chrome/common/chrome_paths.h" 42 #include "chrome/common/chrome_paths.h"
43 #include "chrome/common/net/url_request_context_getter.h" 43 #include "chrome/common/net/url_request_context_getter.h"
44 #include "chrome/common/notification_service.h" 44 #include "chrome/common/notification_service.h"
45 #include "chrome/common/notification_type.h" 45 #include "chrome/common/notification_type.h"
46 #include "chrome/common/pref_names.h" 46 #include "chrome/common/pref_names.h"
47 #include "chrome/common/render_messages.h"
47 #include "chrome/common/url_constants.h" 48 #include "chrome/common/url_constants.h"
48 #include "grit/generated_resources.h" 49 #include "grit/generated_resources.h"
49 #include "net/base/io_buffer.h" 50 #include "net/base/io_buffer.h"
50 #include "net/base/mime_util.h" 51 #include "net/base/mime_util.h"
51 #include "net/base/net_util.h" 52 #include "net/base/net_util.h"
52 #include "net/url_request/url_request_context.h" 53 #include "net/url_request/url_request_context.h"
53 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h" 54 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClie nt.h"
54 #include "ui/base/l10n/l10n_util.h" 55 #include "ui/base/l10n/l10n_util.h"
55 56
56 using base::Time; 57 using base::Time;
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 // Save as HTML only. 893 // Save as HTML only.
893 DCHECK(wait_state_ == NET_FILES); 894 DCHECK(wait_state_ == NET_FILES);
894 DCHECK(save_type_ == SAVE_AS_ONLY_HTML); 895 DCHECK(save_type_ == SAVE_AS_ONLY_HTML);
895 if (waiting_item_queue_.size()) { 896 if (waiting_item_queue_.size()) {
896 DCHECK(all_save_items_count_ == waiting_item_queue_.size()); 897 DCHECK(all_save_items_count_ == waiting_item_queue_.size());
897 SaveNextFile(false); 898 SaveNextFile(false);
898 } 899 }
899 } 900 }
900 } 901 }
901 902
903 bool SavePackage::OnMessageReceived(const IPC::Message& message) {
904 bool handled = true;
905 IPC_BEGIN_MESSAGE_MAP(SavePackage, message)
906 IPC_MESSAGE_HANDLER(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
907 OnReceivedSavableResourceLinksForCurrentPage)
908 IPC_MESSAGE_HANDLER(ViewHostMsg_SendSerializedHtmlData,
909 OnReceivedSerializedHtmlData)
910 IPC_MESSAGE_UNHANDLED(handled = false)
911 IPC_END_MESSAGE_MAP()
912 return handled;
913 }
914
902 // After finishing all SaveItems which need to get data from net. 915 // After finishing all SaveItems which need to get data from net.
903 // We collect all URLs which have local storage and send the 916 // We collect all URLs which have local storage and send the
904 // map:(originalURL:currentLocalPath) to render process (backend). 917 // map:(originalURL:currentLocalPath) to render process (backend).
905 // Then render process will serialize DOM and send data to us. 918 // Then render process will serialize DOM and send data to us.
906 void SavePackage::GetSerializedHtmlDataForCurrentPageWithLocalLinks() { 919 void SavePackage::GetSerializedHtmlDataForCurrentPageWithLocalLinks() {
907 if (wait_state_ != HTML_DATA) 920 if (wait_state_ != HTML_DATA)
908 return; 921 return;
909 std::vector<GURL> saved_links; 922 std::vector<GURL> saved_links;
910 std::vector<FilePath> saved_file_paths; 923 std::vector<FilePath> saved_file_paths;
911 int successful_started_items_count = 0; 924 int successful_started_items_count = 0;
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 } 1395 }
1383 1396
1384 // SelectFileDialog::Listener interface. 1397 // SelectFileDialog::Listener interface.
1385 void SavePackage::FileSelected(const FilePath& path, 1398 void SavePackage::FileSelected(const FilePath& path,
1386 int index, void* params) { 1399 int index, void* params) {
1387 ContinueSave(path, index); 1400 ContinueSave(path, index);
1388 } 1401 }
1389 1402
1390 void SavePackage::FileSelectionCanceled(void* params) { 1403 void SavePackage::FileSelectionCanceled(void* params) {
1391 } 1404 }
OLDNEW
« no previous file with comments | « chrome/browser/download/save_package.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698