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

Unified Diff: net/url_request/const_http_user_agent_settings.h

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change to returning strings by value Created 8 years, 2 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_user_agent_settings.h
diff --git a/net/url_request/const_http_user_agent_settings.h b/net/url_request/const_http_user_agent_settings.h
new file mode 100644
index 0000000000000000000000000000000000000000..b56c03fe3878f454d08a660d58165cd070ce2c3f
--- /dev/null
+++ b/net/url_request/const_http_user_agent_settings.h
@@ -0,0 +1,35 @@
+// 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_USER_AGENT_SETTINGS_H_
+#define NET_URL_REQUEST_CONST_HTTP_USER_AGENT_SETTINGS_H_
+
+#include "net/url_request/const_http_accept_language_and_charset.h"
+
+namespace net {
+
+// An implementation of |HttpUserAgentSettings| that always provides the
willchan no longer on Chromium 2012/10/06 19:32:49 Please name this StaticHttpUserAgentSettings or Ht
+// same constant values for the HTTP Accept-Language, Accept-Charset, and
+// User-Agent headers.
+class NET_EXPORT ConstHttpUserAgentSettings
+ : public ConstHttpAcceptLanguageAndCharset {
willchan no longer on Chromium 2012/10/06 19:32:49 I don't like implementation inheritance (and the s
+ public:
+ ConstHttpUserAgentSettings(const std::string& accept_language,
+ const std::string& accept_charset,
+ const std::string& user_agent);
+ virtual ~ConstHttpUserAgentSettings() {}
+
+ // ConstHttpAcceptLanguageAndCharset implementation
+ virtual std::string GetUserAgent(const GURL& url) OVERRIDE;
+
+ private:
+ const std::string user_agent_;
+
+ DISALLOW_COPY_AND_ASSIGN(ConstHttpUserAgentSettings);
+};
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_CONST_HTTP_USER_AGENT_SETTINGS_H_
+

Powered by Google App Engine
This is Rietveld 408576698