| 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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/web_contents_observer.h" | 18 #include "content/public/browser/web_contents_observer.h" |
| 19 | 19 |
| 20 class DownloadRequestInfoBarDelegate; | 20 class DownloadRequestInfoBarDelegate; |
| 21 class TabContentsWrapper; | 21 class TabContents; |
| 22 typedef TabContents TabContentsWrapper; |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 class NavigationController; | 25 class NavigationController; |
| 25 class WebContents; | 26 class WebContents; |
| 26 } | 27 } |
| 27 | 28 |
| 28 // DownloadRequestLimiter is responsible for determining whether a download | 29 // DownloadRequestLimiter is responsible for determining whether a download |
| 29 // should be allowed or not. It is designed to keep pages from downloading | 30 // should be allowed or not. It is designed to keep pages from downloading |
| 30 // multiple files without user interaction. DownloadRequestLimiter is invoked | 31 // multiple files without user interaction. DownloadRequestLimiter is invoked |
| 31 // from ResourceDispatcherHost any time a download begins | 32 // from ResourceDispatcherHost any time a download begins |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // the TabDownloadState is removed and deleted (by way of Remove). | 242 // the TabDownloadState is removed and deleted (by way of Remove). |
| 242 typedef std::map<content::WebContents*, TabDownloadState*> StateMap; | 243 typedef std::map<content::WebContents*, TabDownloadState*> StateMap; |
| 243 StateMap state_map_; | 244 StateMap state_map_; |
| 244 | 245 |
| 245 static TestingDelegate* delegate_; | 246 static TestingDelegate* delegate_; |
| 246 | 247 |
| 247 DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiter); | 248 DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiter); |
| 248 }; | 249 }; |
| 249 | 250 |
| 250 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ | 251 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ |
| OLD | NEW |