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

Unified Diff: chrome/browser/net/http_server_properties_manager_factory.h

Issue 378823002: Move http_server_properties_manager from chrome/browser/net to net/http. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 6 years, 5 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/net/http_server_properties_manager_factory.h
diff --git a/chrome/browser/net/http_server_properties_manager_factory.h b/chrome/browser/net/http_server_properties_manager_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c2e5349831c210abe79a2ad73a465c7bbae2efe
--- /dev/null
+++ b/chrome/browser/net/http_server_properties_manager_factory.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
Bernhard Bauer 2014/07/08 21:47:21 Update copyright?
mef 2014/07/09 12:12:03 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_FACTORY_H_
+#define CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_FACTORY_H_
+
+#include <string>
+#include <vector>
Bernhard Bauer 2014/07/08 21:47:20 Nit: empty line between system and regular include
mef 2014/07/09 12:12:04 Done.
+#include "base/basictypes.h"
+#include "base/prefs/pref_change_registrar.h"
+#include "chrome/common/pref_names.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+#include "content/public/browser/browser_thread.h"
+#include "net/http/http_server_properties_manager.h"
+
+class PrefService;
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+namespace chrome_browser_net {
+
+using content::BrowserThread;
+
+////////////////////////////////////////////////////////////////////////////////
+// Class for registration and creation of HttpServerPropertiesManager
+class HttpServerPropertiesManagerFactory {
+ public:
+ // Create an instance of HttpServerPropertiesManager.
+ static net::HttpServerPropertiesManager* CreateManager(
+ PrefService* pref_service) {
+ return new net::HttpServerPropertiesManager(
Bernhard Bauer 2014/07/08 21:47:21 I'm sorry that this will mean that you'll have to
mef 2014/07/09 12:12:03 Done.
+ pref_service,
+ prefs::kHttpServerProperties,
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
+ }
+
+ // Register |prefs| for properties managed by HttpServerPropertiesManager.
Bernhard Bauer 2014/07/08 21:47:20 |registry|?
mef 2014/07/09 12:12:04 Done. I think we are registering prefs in |registr
Bernhard Bauer 2014/07/09 12:24:43 Yeah, this way it makes more sense. Thanks!
+ static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
+ registry->RegisterDictionaryPref(
+ prefs::kHttpServerProperties,
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ }
Bernhard Bauer 2014/07/08 21:47:21 private: DISALLOW_IMPLICIT_CONSTRUCTORS?
mef 2014/07/09 12:12:03 Done.
+};
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698