Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: content/browser/android/download_controller_android_impl.h

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed unused vars Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 WebContents* web_contents; 84 WebContents* web_contents;
85 // Default copy constructor is used for passing this struct by value. 85 // Default copy constructor is used for passing this struct by value.
86 }; 86 };
87 struct JavaObject; 87 struct JavaObject;
88 friend struct base::DefaultSingletonTraits<DownloadControllerAndroidImpl>; 88 friend struct base::DefaultSingletonTraits<DownloadControllerAndroidImpl>;
89 DownloadControllerAndroidImpl(); 89 DownloadControllerAndroidImpl();
90 ~DownloadControllerAndroidImpl() override; 90 ~DownloadControllerAndroidImpl() override;
91 91
92 // Helper method for implementing AcquireFileAccessPermission(). 92 // Helper method for implementing AcquireFileAccessPermission().
93 bool HasFileAccessPermission( 93 bool HasFileAccessPermission(
94 base::android::ScopedJavaLocalRef<jobject> j_content_view_core); 94 base::android::ScopedJavaLocalRef<jobject> jwindow_android);
95 95
96 // DownloadControllerAndroid implementation. 96 // DownloadControllerAndroid implementation.
97 void CreateGETDownload(int render_process_id, 97 void CreateGETDownload(int render_process_id,
98 int render_view_id, 98 int render_view_id,
99 int request_id, 99 int request_id,
100 bool must_download) override; 100 bool must_download) override;
101 void OnDownloadStarted(DownloadItem* download_item) override; 101 void OnDownloadStarted(DownloadItem* download_item) override;
102 void StartContextMenuDownload(const ContextMenuParams& params, 102 void StartContextMenuDownload(const ContextMenuParams& params,
103 WebContents* web_contents, 103 WebContents* web_contents,
104 bool is_link, 104 bool is_link,
(...skipping 30 matching lines...) Expand all
135 bool must_download, 135 bool must_download,
136 const DownloadInfoAndroid& info, 136 const DownloadInfoAndroid& info,
137 bool allowed); 137 bool allowed);
138 138
139 // The download item contains dangerous file types. 139 // The download item contains dangerous file types.
140 void OnDangerousDownload(DownloadItem *item); 140 void OnDangerousDownload(DownloadItem *item);
141 141
142 base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents( 142 base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents(
143 WebContents* web_contents); 143 WebContents* web_contents);
144 144
145 base::android::ScopedJavaLocalRef<jobject> GetJavWebContents(
no sievers 2016/05/27 19:09:25 typo... but actually it's unused
Jinsuk Kim 2016/05/30 01:20:57 Removed.
146 WebContents* web_contents);
147
145 // Creates Java object if it is not created already and returns it. 148 // Creates Java object if it is not created already and returns it.
146 JavaObject* GetJavaObject(); 149 JavaObject* GetJavaObject();
147 150
148 JavaObject* java_object_; 151 JavaObject* java_object_;
149 152
150 std::string default_file_name_; 153 std::string default_file_name_;
151 154
152 ScopedVector<DeferredDownloadObserver> deferred_downloads_; 155 ScopedVector<DeferredDownloadObserver> deferred_downloads_;
153 156
154 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); 157 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl);
155 }; 158 };
156 159
157 } // namespace content 160 } // namespace content
158 161
159 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ 162 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698