| 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 status_ = status; | 82 status_ = status; |
| 83 } | 83 } |
| 84 DownloadRequestManager::DownloadStatus download_status() const { | 84 DownloadRequestManager::DownloadStatus download_status() const { |
| 85 return status_; | 85 return status_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Invoked when a user gesture occurs (mouse click, enter or space). This | 88 // Invoked when a user gesture occurs (mouse click, enter or space). This |
| 89 // may result in invoking Remove on DownloadRequestManager. | 89 // may result in invoking Remove on DownloadRequestManager. |
| 90 void OnUserGesture(); | 90 void OnUserGesture(); |
| 91 | 91 |
| 92 // Asks the user if they really want to allow the download. | 92 // Asks the user if they really want to allow the download. Returns |false| |
| 93 // on error (|true| otherwise). |
| 93 // See description above CanDownloadOnIOThread for details on lifetime of | 94 // See description above CanDownloadOnIOThread for details on lifetime of |
| 94 // callback. | 95 // callback. |
| 95 void PromptUserForDownload(TabContents* tab, | 96 bool PromptUserForDownload(TabContents* tab, |
| 96 DownloadRequestManager::Callback* callback); | 97 DownloadRequestManager::Callback* callback); |
| 97 | 98 |
| 98 // Are we showing a prompt to the user? | 99 // Are we showing a prompt to the user? |
| 99 bool is_showing_prompt() const { return (dialog_delegate_ != NULL); } | 100 bool is_showing_prompt() const { return (dialog_delegate_ != NULL); } |
| 100 | 101 |
| 101 // NavigationController we're tracking. | 102 // NavigationController we're tracking. |
| 102 NavigationController* controller() const { return controller_; } | 103 NavigationController* controller() const { return controller_; } |
| 103 | 104 |
| 104 // Invoked from DownloadRequestDialogDelegate. Notifies the delegates and | 105 // Invoked from DownloadRequestDialogDelegate. Notifies the delegates and |
| 105 // changes the status appropriately. | 106 // changes the status appropriately. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // the TabDownloadState is removed and deleted (by way of Remove). | 219 // the TabDownloadState is removed and deleted (by way of Remove). |
| 219 typedef std::map<NavigationController*, TabDownloadState*> StateMap; | 220 typedef std::map<NavigationController*, TabDownloadState*> StateMap; |
| 220 StateMap state_map_; | 221 StateMap state_map_; |
| 221 | 222 |
| 222 static TestingDelegate* delegate_; | 223 static TestingDelegate* delegate_; |
| 223 | 224 |
| 224 DISALLOW_COPY_AND_ASSIGN(DownloadRequestManager); | 225 DISALLOW_COPY_AND_ASSIGN(DownloadRequestManager); |
| 225 }; | 226 }; |
| 226 | 227 |
| 227 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_ | 228 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_MANAGER_H_ |
| OLD | NEW |