| 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_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" |
| 8 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 9 | 10 |
| 10 // Watches for user gesture notifications. | 11 // Watches for user gesture notifications. |
| 11 class DownloadRequestLimiterObserver : public content::WebContentsObserver { | 12 class DownloadRequestLimiterObserver : public content::WebContentsObserver { |
| 12 public: | 13 public: |
| 13 explicit DownloadRequestLimiterObserver(content::WebContents* web_contents); | 14 typedef base::Callback<void(DownloadRequestLimiterObserver*)> |
| 15 DestroyedCallback; |
| 16 |
| 17 DownloadRequestLimiterObserver( |
| 18 content::WebContents* web_contents, |
| 19 const DestroyedCallback& on_destroyed); |
| 14 virtual ~DownloadRequestLimiterObserver(); | 20 virtual ~DownloadRequestLimiterObserver(); |
| 15 | 21 |
| 16 // content::WebContentsObserver overrides. | 22 // content::WebContentsObserver overrides. |
| 17 virtual void DidGetUserGesture() OVERRIDE; | 23 virtual void DidGetUserGesture() OVERRIDE; |
| 24 virtual void WebContentsDestroyed( |
| 25 content::WebContents* web_contents) OVERRIDE; |
| 18 | 26 |
| 19 private: | 27 private: |
| 28 DestroyedCallback on_destroyed_; |
| 29 |
| 20 DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiterObserver); | 30 DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiterObserver); |
| 21 }; | 31 }; |
| 22 | 32 |
| 23 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_ | 33 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_OBSERVER_H_ |
| OLD | NEW |