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 TabContents; | 21 class TabContents; |
22 typedef TabContents TabContentsWrapper; | |
23 | 22 |
24 namespace content { | 23 namespace content { |
25 class NavigationController; | 24 class NavigationController; |
26 class WebContents; | 25 class WebContents; |
27 } | 26 } |
28 | 27 |
29 // DownloadRequestLimiter is responsible for determining whether a download | 28 // DownloadRequestLimiter is responsible for determining whether a download |
30 // should be allowed or not. It is designed to keep pages from downloading | 29 // should be allowed or not. It is designed to keep pages from downloading |
31 // multiple files without user interaction. DownloadRequestLimiter is invoked | 30 // multiple files without user interaction. DownloadRequestLimiter is invoked |
32 // from ResourceDispatcherHost any time a download begins | 31 // from ResourceDispatcherHost any time a download begins |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 // the TabDownloadState is removed and deleted (by way of Remove). | 241 // the TabDownloadState is removed and deleted (by way of Remove). |
243 typedef std::map<content::WebContents*, TabDownloadState*> StateMap; | 242 typedef std::map<content::WebContents*, TabDownloadState*> StateMap; |
244 StateMap state_map_; | 243 StateMap state_map_; |
245 | 244 |
246 static TestingDelegate* delegate_; | 245 static TestingDelegate* delegate_; |
247 | 246 |
248 DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiter); | 247 DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiter); |
249 }; | 248 }; |
250 | 249 |
251 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ | 250 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_ |
OLD | NEW |