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 // 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::NewGetDownload() => | 13 // DownloadController::NewGetDownload() => |
14 // DownloadController.newHttpGetDownload() => | 14 // DownloadController.newHttpGetDownload() => |
15 // DownloadListener.onDownloadStart() / | 15 // DownloadListener.onDownloadStart() / |
16 // DownloadListener2.requestHttpGetDownload() | 16 // DownloadListener2.requestHttpGetDownload() |
17 // | 17 // |
18 | 18 |
19 #ifndef CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_H_ | 19 #ifndef CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_H_ |
20 #define CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_H_ | 20 #define CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_H_ |
21 #pragma once | |
22 | 21 |
23 #include <string> | 22 #include <string> |
24 | 23 |
25 #include "base/android/jni_helper.h" | 24 #include "base/android/jni_helper.h" |
26 #include "base/memory/singleton.h" | 25 #include "base/memory/singleton.h" |
27 #include "content/public/browser/download_item.h" | 26 #include "content/public/browser/download_item.h" |
28 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
29 #include "net/cookies/cookie_monster.h" | 28 #include "net/cookies/cookie_monster.h" |
30 | 29 |
31 namespace net { | 30 namespace net { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 JavaObject* GetJavaObject(); | 116 JavaObject* GetJavaObject(); |
118 | 117 |
119 JavaObject* java_object_; | 118 JavaObject* java_object_; |
120 | 119 |
121 DISALLOW_COPY_AND_ASSIGN(DownloadController); | 120 DISALLOW_COPY_AND_ASSIGN(DownloadController); |
122 }; | 121 }; |
123 | 122 |
124 } // namespace content | 123 } // namespace content |
125 | 124 |
126 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_H_ | 125 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_H_ |
OLD | NEW |