| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // Show or Open a saved page via the Windows shell. | 118 // Show or Open a saved page via the Windows shell. |
| 119 void ShowDownloadInShell(); | 119 void ShowDownloadInShell(); |
| 120 | 120 |
| 121 bool canceled() const { return user_canceled_ || disk_error_occurred_; } | 121 bool canceled() const { return user_canceled_ || disk_error_occurred_; } |
| 122 bool finished() const { return finished_; } | 122 bool finished() const { return finished_; } |
| 123 SavePackageType save_type() const { return save_type_; } | 123 SavePackageType save_type() const { return save_type_; } |
| 124 int tab_id() const { return tab_id_; } | 124 int tab_id() const { return tab_id_; } |
| 125 int id() const { return unique_id_; } | 125 int id() const { return unique_id_; } |
| 126 | 126 |
| 127 // Determines the saved file name based on the information of the |
| 128 // current page, and then starts to download the page. This method |
| 129 // runs in the background and may finish asynchronously after this |
| 130 // method returns. |
| 127 void GetSaveInfo(); | 131 void GetSaveInfo(); |
| 128 | 132 |
| 129 // Statics ------------------------------------------------------------------- | 133 // Statics ------------------------------------------------------------------- |
| 130 | 134 |
| 131 // Used to disable prompting the user for a directory/filename of the saved | 135 // Used to disable prompting the user for a directory/filename of the saved |
| 132 // web page. This is available for testing. | 136 // web page. This is available for testing. |
| 133 static void SetShouldPromptUser(bool should_prompt); | 137 static void SetShouldPromptUser(bool should_prompt); |
| 134 | 138 |
| 135 // Check whether we can do the saving page operation for the specified URL. | 139 // Check whether we can do the saving page operation for the specified URL. |
| 136 static bool IsSavableURL(const GURL& url); | 140 static bool IsSavableURL(const GURL& url); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 friend class SavePackageTest; | 322 friend class SavePackageTest; |
| 319 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames); | 323 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestSuggestedSaveNames); |
| 320 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename); | 324 FRIEND_TEST_ALL_PREFIXES(SavePackageTest, TestLongSafePureFilename); |
| 321 | 325 |
| 322 ScopedRunnableMethodFactory<SavePackage> method_factory_; | 326 ScopedRunnableMethodFactory<SavePackage> method_factory_; |
| 323 | 327 |
| 324 DISALLOW_COPY_AND_ASSIGN(SavePackage); | 328 DISALLOW_COPY_AND_ASSIGN(SavePackage); |
| 325 }; | 329 }; |
| 326 | 330 |
| 327 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ | 331 #endif // CHROME_BROWSER_DOWNLOAD_SAVE_PACKAGE_H_ |
| OLD | NEW |