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

Side by Side Diff: chrome/browser/android/chrome_web_contents_delegate_android.cc

Issue 13037003: permissionrequest API for guest Download. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync @tott Created 7 years, 8 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 | Annotate | Revision Log
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 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" 5 #include "chrome/browser/android/chrome_web_contents_delegate_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/file_select_helper.h" 10 #include "chrome/browser/file_select_helper.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 env, 221 env,
222 obj.obj(), 222 obj.obj(),
223 details_object.obj()); 223 details_object.obj());
224 } 224 }
225 225
226 content::JavaScriptDialogManager* 226 content::JavaScriptDialogManager*
227 ChromeWebContentsDelegateAndroid::GetJavaScriptDialogManager() { 227 ChromeWebContentsDelegateAndroid::GetJavaScriptDialogManager() {
228 return GetJavaScriptDialogManagerInstance(); 228 return GetJavaScriptDialogManagerInstance();
229 } 229 }
230 230
231 bool ChromeWebContentsDelegateAndroid::CanDownload( 231 void ChromeWebContentsDelegateAndroid::CanDownload(
232 content::RenderViewHost* source, 232 content::RenderViewHost* source,
233 int request_id, 233 int request_id,
234 const std::string& request_method) { 234 const std::string& request_method,
235 const base::Callback<void(bool)>& callback) {
235 if (request_method == net::HttpRequestHeaders::kGetMethod) { 236 if (request_method == net::HttpRequestHeaders::kGetMethod) {
236 content::DownloadControllerAndroid::Get()->CreateGETDownload( 237 content::DownloadControllerAndroid::Get()->CreateGETDownload(
237 source, request_id); 238 source, request_id);
238 return false; 239 callback.Run(false);
239 } 240 }
240 // DownloadControllerAndroid::OnPostDownloadStarted() is called for the 241 // DownloadControllerAndroid::OnPostDownloadStarted() is called for the
241 // started download by the default DownloadUIController::Delegate 242 // started download by the default DownloadUIController::Delegate
242 // implementation. 243 // implementation.
243 return true; 244 callback.Run(true);
244 } 245 }
245 246
246 void ChromeWebContentsDelegateAndroid::DidNavigateToPendingEntry( 247 void ChromeWebContentsDelegateAndroid::DidNavigateToPendingEntry(
247 content::WebContents* source) { 248 content::WebContents* source) {
248 navigation_start_time_ = base::TimeTicks::Now(); 249 navigation_start_time_ = base::TimeTicks::Now();
249 } 250 }
250 251
251 void ChromeWebContentsDelegateAndroid::DidNavigateMainFramePostCommit( 252 void ChromeWebContentsDelegateAndroid::DidNavigateMainFramePostCommit(
252 content::WebContents* source) { 253 content::WebContents* source) {
253 if (!IsActiveNavigationGoogleSearch(source)) 254 if (!IsActiveNavigationGoogleSearch(source))
(...skipping 24 matching lines...) Expand all
278 web_contents, url, plugin_path, callback); 279 web_contents, url, plugin_path, callback);
279 return true; 280 return true;
280 #else 281 #else
281 return false; 282 return false;
282 #endif 283 #endif
283 } 284 }
284 285
285 286
286 } // namespace android 287 } // namespace android
287 } // namespace chrome 288 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/android/chrome_web_contents_delegate_android.h ('k') | chrome/browser/download/download_request_limiter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698