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

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

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix failing tests/bugs 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_ANDROID_DEFERRED_DOWNLOAD_OBSERVER_H_
6 #define CONTENT_BROWSER_ANDROID_DEFERRED_DOWNLOAD_OBSERVER_H_
7
8 #include "base/callback.h"
9 #include "base/containers/scoped_ptr_hash_map.h"
10 #include "base/macros.h"
11 #include "content/public/browser/web_contents_observer.h"
12
13 namespace content {
14 class WebContents;
15
16 // Class for handling deferred downloads inside a WebContents. In document
17 // mode, it is possible that a download starts before ContentViewCore gets
18 // created. This class listens to the WebContentsObserver::WasShown() method
19 // before running the download tasks to make sure ContentViewCore is attached
20 // to WebContents.
21 // TODO(qinmin): Remove this when java Tab object creation is no longer pending
22 // on Activity creation.
23 class DeferredDownloadObserver : public WebContentsObserver {
24 public:
25 DeferredDownloadObserver(WebContents* web_contents,
26 const base::Closure& deferred_download_cb);
27 ~DeferredDownloadObserver() override;
28
29 // WebContentsObserver method.
30 void WasShown() override;
31 void WebContentsDestroyed() override;
32
33 private:
34 // Callback to run when WebContents gets shown.
35 base::Closure deferred_download_cb_;
36
37 DISALLOW_COPY_AND_ASSIGN(DeferredDownloadObserver);
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_BROWSER_ANDROID_DEFERRED_DOWNLOAD_OBSERVER_H_
OLDNEW
« no previous file with comments | « content/browser/android/browser_jni_registrar.cc ('k') | content/browser/android/deferred_download_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698