| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_PLUGINS_FLASH_DOWNLOAD_INTERCEPTION_H_ | 5 #ifndef CHROME_BROWSER_PLUGINS_FLASH_DOWNLOAD_INTERCEPTION_H_ |
| 6 #define CHROME_BROWSER_PLUGINS_FLASH_DOWNLOAD_INTERCEPTION_H_ | 6 #define CHROME_BROWSER_PLUGINS_FLASH_DOWNLOAD_INTERCEPTION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class NavigationHandle; | 13 class NavigationHandle; |
| 14 class NavigationThrottle; | 14 class NavigationThrottle; |
| 15 class WebContents; |
| 15 } | 16 } |
| 16 | 17 |
| 17 class HostContentSettingsMap; | 18 class HostContentSettingsMap; |
| 18 class GURL; | 19 class GURL; |
| 19 | 20 |
| 20 // This class creates navigation throttles that intercept navigations to Flash's | 21 // This class creates navigation throttles that intercept navigations to Flash's |
| 21 // download page. The user is queried about activating Flash instead, since | 22 // download page. The user is queried about activating Flash instead, since |
| 22 // Chrome already ships with it. Note that this is an UI thread class. | 23 // Chrome already ships with it. Note that this is an UI thread class. |
| 23 class FlashDownloadInterception { | 24 class FlashDownloadInterception { |
| 24 public: | 25 public: |
| 26 static void InterceptFlashDownloadNavigation(content::WebContents* source); |
| 25 static bool ShouldStopFlashDownloadAction( | 27 static bool ShouldStopFlashDownloadAction( |
| 26 HostContentSettingsMap* host_content_settings_map, | 28 HostContentSettingsMap* host_content_settings_map, |
| 27 const GURL& source_url, | 29 const GURL& source_url, |
| 28 const GURL& target_url, | 30 const GURL& target_url, |
| 29 bool has_user_gesture); | 31 bool has_user_gesture); |
| 30 | 32 |
| 31 static std::unique_ptr<content::NavigationThrottle> MaybeCreateThrottleFor( | 33 static std::unique_ptr<content::NavigationThrottle> MaybeCreateThrottleFor( |
| 32 content::NavigationHandle* handle); | 34 content::NavigationHandle* handle); |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(FlashDownloadInterception); | 37 DISALLOW_COPY_AND_ASSIGN(FlashDownloadInterception); |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 #endif // CHROME_BROWSER_PLUGINS_FLASH_DOWNLOAD_INTERCEPTION_H_ | 40 #endif // CHROME_BROWSER_PLUGINS_FLASH_DOWNLOAD_INTERCEPTION_H_ |
| OLD | NEW |