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

Unified Diff: net/url_request/const_http_accept_language_and_charset.h

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address erikwright's second round of comments. Created 8 years, 3 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: net/url_request/const_http_accept_language_and_charset.h
diff --git a/net/url_request/const_http_accept_language_and_charset.h b/net/url_request/const_http_accept_language_and_charset.h
new file mode 100644
index 0000000000000000000000000000000000000000..f325cec8f9b9bad5f0a903e8af95a714ea77b772
--- /dev/null
+++ b/net/url_request/const_http_accept_language_and_charset.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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.
+
+#ifndef NET_URL_REQUEST_CONST_HTTP_ACCEPT_LANGUAGE_AND_CHARSET_H_
+#define NET_URL_REQUEST_CONST_HTTP_ACCEPT_LANGUAGE_AND_CHARSET_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "net/url_request/http_user_agent_settings.h"
+
+namespace net {
+
+// A partial implementation of |HttpUserAgentSettings| that always provides
+// the same constant values for the HTTP Accept-Language and Accept-Charset
+// headers. Implementors can inherit from this class and implement
+// |GetUserAgent()|.
+class NET_EXPORT ConstHttpAcceptLanguageAndCharset
+ : public HttpUserAgentSettings {
mmenke 2012/09/26 16:28:20 4 space indent.
+ public:
+ // HttpUserAgentSettings implementation
+ virtual const std::string& GetAcceptLanguage() OVERRIDE;
+ virtual const std::string& GetAcceptCharset() OVERRIDE;
+
+ protected:
+ ConstHttpAcceptLanguageAndCharset(const std::string& accept_language,
+ const std::string& accept_charset);
+ virtual ~ConstHttpAcceptLanguageAndCharset() {}
+
+ private:
+ const std::string accept_language_;
+ const std::string accept_charset_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConstHttpAcceptLanguageAndCharset);
+};
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_CONST_HTTP_ACCEPT_LANGUAGE_AND_CHARSET_H_
+

Powered by Google App Engine
This is Rietveld 408576698