Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_URL_PARAMETERS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 save_info_.suggested_name = suggested_name; | 94 save_info_.suggested_name = suggested_name; |
| 95 } | 95 } |
| 96 void set_offset(int64 offset) { save_info_.offset = offset; } | 96 void set_offset(int64 offset) { save_info_.offset = offset; } |
| 97 void set_hash_state(std::string hash_state) { | 97 void set_hash_state(std::string hash_state) { |
| 98 save_info_.hash_state = hash_state; | 98 save_info_.hash_state = hash_state; |
| 99 } | 99 } |
| 100 void set_prompt(bool prompt) { save_info_.prompt_for_save_location = prompt; } | 100 void set_prompt(bool prompt) { save_info_.prompt_for_save_location = prompt; } |
| 101 void set_file(base::File file) { | 101 void set_file(base::File file) { |
| 102 save_info_.file = file.Pass(); | 102 save_info_.file = file.Pass(); |
| 103 } | 103 } |
| 104 void set_do_not_prompt_for_login(bool do_not_prompt) { | |
|
baranovich
2014/12/09 23:33:49
If this method is added then load_flags/set_load_f
jam
2014/12/10 17:53:25
remove them
baranovich
2014/12/10 22:24:38
Done.
| |
| 105 do_not_prompt_for_login_ = do_not_prompt; | |
| 106 } | |
| 104 | 107 |
| 105 const OnStartedCallback& callback() const { return callback_; } | 108 const OnStartedCallback& callback() const { return callback_; } |
| 106 bool content_initiated() const { return content_initiated_; } | 109 bool content_initiated() const { return content_initiated_; } |
| 107 int load_flags() const { return load_flags_; } | 110 int load_flags() const { return load_flags_; } |
| 108 const std::string& last_modified() const { return last_modified_; } | 111 const std::string& last_modified() const { return last_modified_; } |
| 109 const std::string& etag() const { return etag_; } | 112 const std::string& etag() const { return etag_; } |
| 110 const std::string& method() const { return method_; } | 113 const std::string& method() const { return method_; } |
| 111 const std::string& post_body() const { return post_body_; } | 114 const std::string& post_body() const { return post_body_; } |
| 112 int64 post_id() const { return post_id_; } | 115 int64 post_id() const { return post_id_; } |
| 113 bool prefer_cache() const { return prefer_cache_; } | 116 bool prefer_cache() const { return prefer_cache_; } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 127 return resource_context_; | 130 return resource_context_; |
| 128 } | 131 } |
| 129 const base::FilePath& file_path() const { return save_info_.file_path; } | 132 const base::FilePath& file_path() const { return save_info_.file_path; } |
| 130 const base::string16& suggested_name() const { | 133 const base::string16& suggested_name() const { |
| 131 return save_info_.suggested_name; | 134 return save_info_.suggested_name; |
| 132 } | 135 } |
| 133 int64 offset() const { return save_info_.offset; } | 136 int64 offset() const { return save_info_.offset; } |
| 134 const std::string& hash_state() const { return save_info_.hash_state; } | 137 const std::string& hash_state() const { return save_info_.hash_state; } |
| 135 bool prompt() const { return save_info_.prompt_for_save_location; } | 138 bool prompt() const { return save_info_.prompt_for_save_location; } |
| 136 const GURL& url() const { return url_; } | 139 const GURL& url() const { return url_; } |
| 140 bool do_not_prompt_for_login() const { return do_not_prompt_for_login_; } | |
| 137 | 141 |
| 138 // Note that this is state changing--the DownloadUrlParameters object | 142 // Note that this is state changing--the DownloadUrlParameters object |
| 139 // will not have a file attached to it after this call. | 143 // will not have a file attached to it after this call. |
| 140 base::File GetFile() { return save_info_.file.Pass(); } | 144 base::File GetFile() { return save_info_.file.Pass(); } |
| 141 | 145 |
| 142 private: | 146 private: |
| 143 OnStartedCallback callback_; | 147 OnStartedCallback callback_; |
| 144 bool content_initiated_; | 148 bool content_initiated_; |
| 145 RequestHeadersType request_headers_; | 149 RequestHeadersType request_headers_; |
| 146 int load_flags_; | 150 int load_flags_; |
| 147 std::string last_modified_; | 151 std::string last_modified_; |
| 148 std::string etag_; | 152 std::string etag_; |
| 149 std::string method_; | 153 std::string method_; |
| 150 std::string post_body_; | 154 std::string post_body_; |
| 151 int64 post_id_; | 155 int64 post_id_; |
| 152 bool prefer_cache_; | 156 bool prefer_cache_; |
| 153 Referrer referrer_; | 157 Referrer referrer_; |
| 154 std::string referrer_encoding_; | 158 std::string referrer_encoding_; |
| 155 int render_process_host_id_; | 159 int render_process_host_id_; |
| 156 int render_view_host_routing_id_; | 160 int render_view_host_routing_id_; |
| 157 ResourceContext* resource_context_; | 161 ResourceContext* resource_context_; |
| 158 DownloadSaveInfo save_info_; | 162 DownloadSaveInfo save_info_; |
| 159 GURL url_; | 163 GURL url_; |
| 164 bool do_not_prompt_for_login_; | |
| 160 | 165 |
| 161 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); | 166 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 } // namespace content | 169 } // namespace content |
| 165 | 170 |
| 166 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ | 171 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ |
| OLD | NEW |