| 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 NET_HTTP_HTTP_CONTENT_DISPOSITION_H_ | 5 #ifndef NET_HTTP_HTTP_CONTENT_DISPOSITION_H_ |
| 6 #define NET_HTTP_HTTP_CONTENT_DISPOSITION_H_ | 6 #define NET_HTTP_HTTP_CONTENT_DISPOSITION_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 class NET_EXPORT HttpContentDisposition { | 16 class NET_EXPORT HttpContentDisposition { |
| 17 public: | 17 public: |
| 18 enum Type { | 18 enum Type { |
| 19 INLINE, | 19 INLINE, |
| 20 ATTACHMENT, | 20 ATTACHMENT, |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 HttpContentDisposition(const std::string& header, | 23 HttpContentDisposition(const std::string& header, |
| 24 const std::string& referrer_charset); | 24 const std::string& default_charset); |
| 25 ~HttpContentDisposition(); | 25 ~HttpContentDisposition(); |
| 26 | 26 |
| 27 bool is_attachment() const { return type() == ATTACHMENT; } | 27 bool is_attachment() const { return type() == ATTACHMENT; } |
| 28 | 28 |
| 29 Type type() const { return type_; } | 29 Type type() const { return type_; } |
| 30 const std::string& filename() const { return filename_; } | 30 const std::string& filename() const { return filename_; } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 void Parse(const std::string& header, const std::string& referrer_charset); | 33 void Parse(const std::string& header, const std::string& default_charset); |
| 34 std::string::const_iterator ConsumeDispositionType( | 34 std::string::const_iterator ConsumeDispositionType( |
| 35 std::string::const_iterator begin, std::string::const_iterator end); | 35 std::string::const_iterator begin, std::string::const_iterator end); |
| 36 | 36 |
| 37 Type type_; | 37 Type type_; |
| 38 std::string filename_; | 38 std::string filename_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(HttpContentDisposition); | 40 DISALLOW_COPY_AND_ASSIGN(HttpContentDisposition); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace net | 43 } // namespace net |
| 44 | 44 |
| 45 #endif // NET_HTTP_HTTP_CONTENT_DISPOSITION_H_ | 45 #endif // NET_HTTP_HTTP_CONTENT_DISPOSITION_H_ |
| OLD | NEW |