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

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

Issue 11640007: Make the UI an observer of downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android clang build Created 7 years, 9 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 bool ChromeWebContentsDelegateAndroid::CanDownload( 270 bool ChromeWebContentsDelegateAndroid::CanDownload(
271 content::RenderViewHost* source, 271 content::RenderViewHost* source,
272 int request_id, 272 int request_id,
273 const std::string& request_method) { 273 const std::string& request_method) {
274 if (request_method == net::HttpRequestHeaders::kGetMethod) { 274 if (request_method == net::HttpRequestHeaders::kGetMethod) {
275 content::DownloadControllerAndroid::Get()->CreateGETDownload( 275 content::DownloadControllerAndroid::Get()->CreateGETDownload(
276 source, request_id); 276 source, request_id);
277 return false; 277 return false;
278 } 278 }
279 // DownloadControllerAndroid::OnPostDownloadStarted() is called for the
280 // started download by the default DownloadUIController::Delegate
281 // implementation.
279 return true; 282 return true;
280 } 283 }
281 284
282 void ChromeWebContentsDelegateAndroid::OnStartDownload(
283 WebContents* source,
284 content::DownloadItem* download) {
285 content::DownloadControllerAndroid::Get()->OnPostDownloadStarted(
286 source, download);
287 }
288
289 void ChromeWebContentsDelegateAndroid::DidNavigateToPendingEntry( 285 void ChromeWebContentsDelegateAndroid::DidNavigateToPendingEntry(
290 content::WebContents* source) { 286 content::WebContents* source) {
291 navigation_start_time_ = base::TimeTicks::Now(); 287 navigation_start_time_ = base::TimeTicks::Now();
292 } 288 }
293 289
294 void ChromeWebContentsDelegateAndroid::DidNavigateMainFramePostCommit( 290 void ChromeWebContentsDelegateAndroid::DidNavigateMainFramePostCommit(
295 content::WebContents* source) { 291 content::WebContents* source) {
296 if (!IsActiveNavigationGoogleSearch(source)) 292 if (!IsActiveNavigationGoogleSearch(source))
297 return; 293 return;
298 294
(...skipping 22 matching lines...) Expand all
321 web_contents, url, plugin_path, callback); 317 web_contents, url, plugin_path, callback);
322 return true; 318 return true;
323 #else 319 #else
324 return false; 320 return false;
325 #endif 321 #endif
326 } 322 }
327 323
328 324
329 } // namespace android 325 } // namespace android
330 } // namespace chrome 326 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/android/chrome_web_contents_delegate_android.h ('k') | chrome/browser/download/all_download_item_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698