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

Side by Side Diff: content/public/browser/download_manager_delegate.h

Issue 9651020: Pass content-type resources to web intents. Goes through download, then invokes the p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move dispatch logic client-side. Created 8 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 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Allows the delegate to override completion of the download. If this 60 // Allows the delegate to override completion of the download. If this
61 // function returns false, the download completion is delayed and the 61 // function returns false, the download completion is delayed and the
62 // delegate is responsible for making sure that 62 // delegate is responsible for making sure that
63 // DownloadItem::MaybeCompleteDownload is called at some point in the 63 // DownloadItem::MaybeCompleteDownload is called at some point in the
64 // future. Note that at that point this function will be called again, 64 // future. Note that at that point this function will be called again,
65 // and is responsible for returning true when it really is ok for the 65 // and is responsible for returning true when it really is ok for the
66 // download to complete. 66 // download to complete.
67 virtual bool ShouldCompleteDownload(DownloadItem* item); 67 virtual bool ShouldCompleteDownload(DownloadItem* item);
68 68
69 // Allows the delegate to indicate that the downloaded resource should be
70 // dispatched as a web intent.
71 virtual bool ShouldOpenWithWebIntent(DownloadItem* item);
72
69 // Allows the delegate to override opening the download. If this function 73 // Allows the delegate to override opening the download. If this function
70 // returns false, the delegate needs to call 74 // returns false, the delegate needs to call
71 // DownloadItem::DelayedDownloadOpened when it's done with the item, 75 // DownloadItem::DelayedDownloadOpened when it's done with the item,
72 // and is responsible for opening it. This function is called 76 // and is responsible for opening it. This function is called
73 // after the final rename, but before the download state is set to COMPLETED. 77 // after the final rename, but before the download state is set to COMPLETED.
74 virtual bool ShouldOpenDownload(DownloadItem* item); 78 virtual bool ShouldOpenDownload(DownloadItem* item);
75 79
76 // Returns true if we need to generate a binary hash for downloads. 80 // Returns true if we need to generate a binary hash for downloads.
77 virtual bool GenerateFileHash(); 81 virtual bool GenerateFileHash();
78 82
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual void ChooseSavePath(WebContents* web_contents, 117 virtual void ChooseSavePath(WebContents* web_contents,
114 const FilePath& suggested_path, 118 const FilePath& suggested_path,
115 const FilePath::StringType& default_extension, 119 const FilePath::StringType& default_extension,
116 bool can_save_as_complete, 120 bool can_save_as_complete,
117 SaveFilePathPickedCallback callback) {} 121 SaveFilePathPickedCallback callback) {}
118 }; 122 };
119 123
120 } // namespace content 124 } // namespace content
121 125
122 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ 126 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698