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

Side by Side Diff: content/shell/shell_download_manager_delegate.h

Issue 23316003: [content shell] move browser process stuff into browser/ subdir (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
6 #define CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/public/browser/download_manager_delegate.h"
11
12 namespace content {
13
14 class DownloadManager;
15
16 class ShellDownloadManagerDelegate
17 : public DownloadManagerDelegate,
18 public base::RefCountedThreadSafe<ShellDownloadManagerDelegate> {
19 public:
20 ShellDownloadManagerDelegate();
21
22 void SetDownloadManager(DownloadManager* manager);
23
24 virtual void Shutdown() OVERRIDE;
25 virtual bool DetermineDownloadTarget(
26 DownloadItem* download,
27 const DownloadTargetCallback& callback) OVERRIDE;
28 virtual bool ShouldOpenDownload(
29 DownloadItem* item,
30 const DownloadOpenDelayedCallback& callback) OVERRIDE;
31 virtual void GetNextId(const DownloadIdCallback& callback) OVERRIDE;
32
33 // Inhibits prompting and sets the default download path.
34 void SetDownloadBehaviorForTesting(
35 const base::FilePath& default_download_path);
36
37 protected:
38 // To allow subclasses for testing.
39 virtual ~ShellDownloadManagerDelegate();
40
41 private:
42 friend class base::RefCountedThreadSafe<ShellDownloadManagerDelegate>;
43
44
45 void GenerateFilename(uint32 download_id,
46 const DownloadTargetCallback& callback,
47 const base::FilePath& generated_name,
48 const base::FilePath& suggested_directory);
49 void OnDownloadPathGenerated(uint32 download_id,
50 const DownloadTargetCallback& callback,
51 const base::FilePath& suggested_path);
52 void ChooseDownloadPath(uint32 download_id,
53 const DownloadTargetCallback& callback,
54 const base::FilePath& suggested_path);
55
56 DownloadManager* download_manager_;
57 base::FilePath default_download_path_;
58 bool suppress_prompting_;
59
60 DISALLOW_COPY_AND_ASSIGN(ShellDownloadManagerDelegate);
61 };
62
63 } // namespace content
64
65 #endif // CONTENT_SHELL_SHELL_DOWNLOAD_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/shell/shell_devtools_frontend.cc ('k') | content/shell/shell_download_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698