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

Unified Diff: chrome/browser/download/download_state_info.h

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed an early return to a DCHECK. Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_state_info.h
diff --git a/chrome/browser/download/download_state_info.h b/chrome/browser/download/download_state_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..83abc445ae4ca8e51f737e947e17b7069074413c
--- /dev/null
+++ b/chrome/browser/download/download_state_info.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
Paweł Hajdan Jr. 2011/05/23 14:04:23 nit: Remove this line.
+
+#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_
+#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_
+#pragma once
+
+#include "base/file_path.h"
+
+// Contains information relating to the process of determining what to do with
+// the download.
+struct DownloadStateInfo {
+ DownloadStateInfo();
+ DownloadStateInfo(bool has_user_gesture,
+ bool prompt_user_for_save_location);
+ DownloadStateInfo(const FilePath& target,
+ const FilePath& forced_name,
+ bool has_user_gesture,
+ bool prompt_user_for_save_location,
+ int uniquifier,
+ bool dangerous_file,
+ bool dangerous_url,
+ bool extension_install);
+
+ // Indicates if the download is dangerous.
+ bool IsDangerous() const;
+
+ // The original name for a dangerous download, specified by the request.
+ FilePath target_name;
+
+ // The path where we save the download. Typically generated.
+ FilePath suggested_path;
+
+ // A number that should be added to the suggested path to make it unique.
+ // 0 means no number should be appended. It is eventually incorporated
+ // into the final file name.
+ int path_uniquifier;
+
+ // True if the download is the result of user action.
+ bool has_user_gesture;
+
+ // True if we should display the 'save as...' UI and prompt the user
+ // for the download location.
+ // False if the UI should be suppressed and the download performed to the
+ // default location.
+ bool prompt_user_for_save_location;
+
+ // True if this download file is potentially dangerous (ex: exe, dll, ...).
+ bool is_dangerous_file;
+
+ // If safebrowsing believes this URL leads to malware.
+ bool is_dangerous_url;
+
+ // True if this download is for extension install.
+ bool is_extension_install;
+
+ // True if this download's file name was specified initially.
+ FilePath force_file_name;
+};
+
+#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698