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

Unified Diff: chrome/browser/policy/cloud/policy_header_service_factory.h

Issue 99433004: Add a header when fetching pages under the DMServer URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed per willchan's feedback Created 7 years 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/policy/cloud/policy_header_service_factory.h
diff --git a/chrome/browser/policy/cloud/policy_header_service_factory.h b/chrome/browser/policy/cloud/policy_header_service_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..c75455e04be80876deed4ab6c06a16ab390af09c
--- /dev/null
+++ b/chrome/browser/policy/cloud/policy_header_service_factory.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2013 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 CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_
+#define CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_
+
+#include "base/memory/singleton.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
+
+namespace policy {
+
+class PolicyHeaderService;
+
+// Factory for PolicyHeaderService objects. PolicyHeaderService is not actually
+// a BrowserContextKeyedService, so this class wraps PolicyHeaderService in
+// a BrowserContextKeyedService internally.
+class PolicyHeaderServiceFactory : public BrowserContextKeyedServiceFactory {
+ public:
+ // Returns the instance of PolicyHeaderService for the passed |context|, or
+ // NULL if there is none (for instance, for incognito windows).
+ static PolicyHeaderService* GetForBrowserContext(
+ content::BrowserContext* context);
+
+ // Returns an instance of the PolicyHeaderServiceFactory singleton.
+ static PolicyHeaderServiceFactory* GetInstance();
+
+ protected:
+ // BrowserContextKeyedServiceFactory implementation.
+ virtual BrowserContextKeyedService* BuildServiceInstanceFor(
+ content::BrowserContext* profile) const OVERRIDE;
+
+ private:
+ friend struct DefaultSingletonTraits<PolicyHeaderServiceFactory>;
+
+ PolicyHeaderServiceFactory();
+ virtual ~PolicyHeaderServiceFactory();
+
+ DISALLOW_COPY_AND_ASSIGN(PolicyHeaderServiceFactory);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_CLOUD_POLICY_HEADER_SERVICE_FACTORY_H_
« no previous file with comments | « chrome/browser/policy/cloud/policy_header_service.cc ('k') | chrome/browser/policy/cloud/policy_header_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698