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

Side by Side Diff: ui/base/dragdrop/download_file_interface.h

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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
« no previous file with comments | « ui/base/dragdrop/DEPS ('k') | ui/base/dragdrop/drag_drop_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_
6 #define UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_
7
8 #include "build/build_config.h"
9
10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h"
12
13 #include "ui/base/ui_base_export.h"
14
15 #if defined(OS_WIN)
16 #include <objidl.h>
17 #endif
18
19 namespace base {
20 class FilePath;
21 }
22
23 namespace ui {
24
25 // TODO(benjhayden, anybody): Do these need to be RefCountedThreadSafe?
26
27 // Defines the interface to observe the status of file download.
28 class UI_BASE_EXPORT DownloadFileObserver
29 : public base::RefCountedThreadSafe<DownloadFileObserver> {
30 public:
31 virtual void OnDownloadCompleted(const base::FilePath& file_path) = 0;
32 virtual void OnDownloadAborted() = 0;
33
34 protected:
35 friend class base::RefCountedThreadSafe<DownloadFileObserver>;
36 virtual ~DownloadFileObserver() {}
37 };
38
39 // Defines the interface to control how a file is downloaded.
40 class UI_BASE_EXPORT DownloadFileProvider
41 : public base::RefCountedThreadSafe<DownloadFileProvider> {
42 public:
43 // Starts the download asynchronously and returns immediately.
44 virtual void Start(DownloadFileObserver* observer) = 0;
45
46 // Returns true if the download succeeded and false otherwise. Waits until the
47 // download is completed/cancelled/interrupted before returning.
48 virtual bool Wait() = 0;
49
50 // Cancels the download.
51 virtual void Stop() = 0;
52
53 protected:
54 friend class base::RefCountedThreadSafe<DownloadFileProvider>;
55 virtual ~DownloadFileProvider() {}
56 };
57
58 } // namespace ui
59
60 #endif // UI_BASE_DRAGDROP_DOWNLOAD_FILE_INTERFACE_H_
OLDNEW
« no previous file with comments | « ui/base/dragdrop/DEPS ('k') | ui/base/dragdrop/drag_drop_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698