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 // |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 std::string cookie; | 66 std::string cookie; |
67 std::string referer; | 67 std::string referer; |
68 bool has_user_gesture; | 68 bool has_user_gesture; |
69 | 69 |
70 WebContents* web_contents; | 70 WebContents* web_contents; |
71 // Default copy constructor is used for passing this struct by value. | 71 // Default copy constructor is used for passing this struct by value. |
72 }; | 72 }; |
73 struct JavaObject; | 73 struct JavaObject; |
74 friend struct DefaultSingletonTraits<DownloadControllerAndroidImpl>; | 74 friend struct DefaultSingletonTraits<DownloadControllerAndroidImpl>; |
75 DownloadControllerAndroidImpl(); | 75 DownloadControllerAndroidImpl(); |
76 virtual ~DownloadControllerAndroidImpl(); | 76 ~DownloadControllerAndroidImpl() override; |
77 | 77 |
78 // DownloadControllerAndroid implementation. | 78 // DownloadControllerAndroid implementation. |
79 virtual void CreateGETDownload(int render_process_id, int render_view_id, | 79 void CreateGETDownload(int render_process_id, |
80 int request_id) override; | 80 int render_view_id, |
81 virtual void OnDownloadStarted(DownloadItem* download_item) override; | 81 int request_id) override; |
82 virtual void StartContextMenuDownload( | 82 void OnDownloadStarted(DownloadItem* download_item) override; |
83 const ContextMenuParams& params, WebContents* web_contents, | 83 void StartContextMenuDownload(const ContextMenuParams& params, |
84 bool is_link) override; | 84 WebContents* web_contents, |
85 virtual void DangerousDownloadValidated( | 85 bool is_link) override; |
86 WebContents* web_contents, int download_id, bool accept) override; | 86 void DangerousDownloadValidated(WebContents* web_contents, |
| 87 int download_id, |
| 88 bool accept) override; |
87 | 89 |
88 // DownloadItem::Observer interface. | 90 // DownloadItem::Observer interface. |
89 virtual void OnDownloadUpdated(DownloadItem* item) override; | 91 void OnDownloadUpdated(DownloadItem* item) override; |
90 | 92 |
91 typedef base::Callback<void(const DownloadInfoAndroid&)> | 93 typedef base::Callback<void(const DownloadInfoAndroid&)> |
92 GetDownloadInfoCB; | 94 GetDownloadInfoCB; |
93 void PrepareDownloadInfo(const GlobalRequestID& global_id, | 95 void PrepareDownloadInfo(const GlobalRequestID& global_id, |
94 const GetDownloadInfoCB& callback); | 96 const GetDownloadInfoCB& callback); |
95 void CheckPolicyAndLoadCookies(const DownloadInfoAndroid& info, | 97 void CheckPolicyAndLoadCookies(const DownloadInfoAndroid& info, |
96 const GetDownloadInfoCB& callback, | 98 const GetDownloadInfoCB& callback, |
97 const GlobalRequestID& global_id, | 99 const GlobalRequestID& global_id, |
98 const net::CookieList& cookie_list); | 100 const net::CookieList& cookie_list); |
99 void DoLoadCookies(const DownloadInfoAndroid& info, | 101 void DoLoadCookies(const DownloadInfoAndroid& info, |
(...skipping 21 matching lines...) Expand all Loading... |
121 JavaObject* GetJavaObject(); | 123 JavaObject* GetJavaObject(); |
122 | 124 |
123 JavaObject* java_object_; | 125 JavaObject* java_object_; |
124 | 126 |
125 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); | 127 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); |
126 }; | 128 }; |
127 | 129 |
128 } // namespace content | 130 } // namespace content |
129 | 131 |
130 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ | 132 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ |
OLD | NEW |