| 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 // This class pairs with DownloadController on Java side to forward requests | 5 // This class pairs with DownloadController on Java side to forward requests |
| 6 // for GET downloads to the current DownloadListener. POST downloads are | 6 // for GET downloads to the current DownloadListener. POST downloads are |
| 7 // handled on the native side. | 7 // handled on the native side. |
| 8 // | 8 // |
| 9 // Both classes are Singleton classes. C++ object owns Java object. | 9 // Both classes are Singleton classes. C++ object owns Java object. |
| 10 // | 10 // |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Helper method for implementing AcquireFileAccessPermission(). | 75 // Helper method for implementing AcquireFileAccessPermission(). |
| 76 bool HasFileAccessPermission(ui::WindowAndroid* window_android); | 76 bool HasFileAccessPermission(ui::WindowAndroid* window_android); |
| 77 | 77 |
| 78 // DownloadControllerBase implementation. | 78 // DownloadControllerBase implementation. |
| 79 void OnDownloadStarted(content::DownloadItem* download_item) override; | 79 void OnDownloadStarted(content::DownloadItem* download_item) override; |
| 80 void StartContextMenuDownload(const content::ContextMenuParams& params, | 80 void StartContextMenuDownload(const content::ContextMenuParams& params, |
| 81 content::WebContents* web_contents, | 81 content::WebContents* web_contents, |
| 82 bool is_link, | 82 bool is_link, |
| 83 const std::string& extra_headers) override; | 83 const std::string& extra_headers) override; |
| 84 void DangerousDownloadValidated(content::WebContents* web_contents, | |
| 85 const std::string& download_guid, | |
| 86 bool accept) override; | |
| 87 | 84 |
| 88 // DownloadItem::Observer interface. | 85 // DownloadItem::Observer interface. |
| 89 void OnDownloadUpdated(content::DownloadItem* item) override; | 86 void OnDownloadUpdated(content::DownloadItem* item) override; |
| 90 | 87 |
| 91 // The download item contains dangerous file types. | 88 // The download item contains dangerous file types. |
| 92 void OnDangerousDownload(content::DownloadItem *item); | 89 void OnDangerousDownload(content::DownloadItem *item); |
| 93 | 90 |
| 94 base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents( | 91 base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents( |
| 95 content::WebContents* web_contents); | 92 content::WebContents* web_contents); |
| 96 | 93 |
| 97 // Creates Java object if it is not created already and returns it. | 94 // Creates Java object if it is not created already and returns it. |
| 98 JavaObject* GetJavaObject(); | 95 JavaObject* GetJavaObject(); |
| 99 | 96 |
| 100 JavaObject* java_object_; | 97 JavaObject* java_object_; |
| 101 | 98 |
| 102 std::string default_file_name_; | 99 std::string default_file_name_; |
| 103 | 100 |
| 104 DISALLOW_COPY_AND_ASSIGN(DownloadController); | 101 DISALLOW_COPY_AND_ASSIGN(DownloadController); |
| 105 }; | 102 }; |
| 106 | 103 |
| 107 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ | 104 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ |
| OLD | NEW |