OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 GetSerializedHtmlDataForCurrentPageWithLocalLinks( | 832 GetSerializedHtmlDataForCurrentPageWithLocalLinks( |
833 saved_links, saved_file_paths, relative_dir_name); | 833 saved_links, saved_file_paths, relative_dir_name); |
834 } | 834 } |
835 | 835 |
836 // Process the serialized HTML content data of a specified web page | 836 // Process the serialized HTML content data of a specified web page |
837 // retrieved from render process. | 837 // retrieved from render process. |
838 void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url, | 838 void SavePackage::OnReceivedSerializedHtmlData(const GURL& frame_url, |
839 const std::string& data, | 839 const std::string& data, |
840 int32 status) { | 840 int32 status) { |
841 webkit_glue::DomSerializerDelegate::PageSavingSerializationStatus flag = | 841 webkit_glue::DomSerializerDelegate::PageSavingSerializationStatus flag = |
842 static_cast<webkit_glue::DomSerializerDelegate::PageSavingSerializationSta
tus> | 842 static_cast<webkit_glue::DomSerializerDelegate:: |
843 (status); | 843 PageSavingSerializationStatus>(status); |
844 // Check current state. | 844 // Check current state. |
845 if (wait_state_ != HTML_DATA) | 845 if (wait_state_ != HTML_DATA) |
846 return; | 846 return; |
847 | 847 |
848 int id = tab_id(); | 848 int id = tab_id(); |
849 // If the all frames are finished saving, we need to close the | 849 // If the all frames are finished saving, we need to close the |
850 // remaining SaveItems. | 850 // remaining SaveItems. |
851 if (flag == webkit_glue::DomSerializerDelegate::ALL_FRAMES_ARE_FINISHED) { | 851 if (flag == webkit_glue::DomSerializerDelegate::ALL_FRAMES_ARE_FINISHED) { |
852 for (SaveUrlItemMap::iterator it = in_progress_items_.begin(); | 852 for (SaveUrlItemMap::iterator it = in_progress_items_.begin(); |
853 it != in_progress_items_.end(); ++it) { | 853 it != in_progress_items_.end(); ++it) { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 *pure_file_name = | 1104 *pure_file_name = |
1105 pure_file_name->substr(0, available_length); | 1105 pure_file_name->substr(0, available_length); |
1106 return true; | 1106 return true; |
1107 } | 1107 } |
1108 | 1108 |
1109 // Not enough room to even use a shortened |pure_file_name|. | 1109 // Not enough room to even use a shortened |pure_file_name|. |
1110 pure_file_name->clear(); | 1110 pure_file_name->clear(); |
1111 return false; | 1111 return false; |
1112 } | 1112 } |
1113 | 1113 |
OLD | NEW |