| 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 // |
| 11 // Call sequence | 11 // Call sequence |
| 12 // GET downloads: | 12 // GET downloads: |
| 13 // DownloadController::CreateGETDownload() => | 13 // DownloadController::CreateGETDownload() => |
| 14 // DownloadController.newHttpGetDownload() => | 14 // DownloadController.newHttpGetDownload() => |
| 15 // DownloadListener.onDownloadStart() / | 15 // DownloadListener.onDownloadStart() / |
| 16 // DownloadListener2.requestHttpGetDownload() | 16 // DownloadListener2.requestHttpGetDownload() |
| 17 // | 17 // |
| 18 | 18 |
| 19 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ | 19 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ |
| 20 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ | 20 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ |
| 21 | 21 |
| 22 #include "base/android/scoped_java_ref.h" | 22 #include "base/android/scoped_java_ref.h" |
| 23 #include "base/memory/singleton.h" | 23 #include "base/memory/singleton.h" |
| 24 #include "chrome/browser/android/download/download_controller_base.h" | 24 #include "chrome/browser/android/download/download_controller_base.h" |
| 25 | 25 |
| 26 namespace net { | |
| 27 class URLRequest; | |
| 28 } | |
| 29 | |
| 30 namespace ui { | 26 namespace ui { |
| 31 class WindowAndroid; | 27 class WindowAndroid; |
| 32 } | 28 } |
| 33 | 29 |
| 34 namespace content { | 30 namespace content { |
| 35 class WebContents; | 31 class WebContents; |
| 36 } | 32 } |
| 37 | 33 |
| 38 class DownloadController : public DownloadControllerBase { | 34 class DownloadController : public DownloadControllerBase { |
| 39 public: | 35 public: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 JavaObject* GetJavaObject(); | 91 JavaObject* GetJavaObject(); |
| 96 | 92 |
| 97 JavaObject* java_object_; | 93 JavaObject* java_object_; |
| 98 | 94 |
| 99 std::string default_file_name_; | 95 std::string default_file_name_; |
| 100 | 96 |
| 101 DISALLOW_COPY_AND_ASSIGN(DownloadController); | 97 DISALLOW_COPY_AND_ASSIGN(DownloadController); |
| 102 }; | 98 }; |
| 103 | 99 |
| 104 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ | 100 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ |
| OLD | NEW |