summaryrefslogtreecommitdiffstats
path: root/chrome_frame/policy_settings.h
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-15 14:41:48 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-15 14:41:48 +0000
commit55604d73d488ecdbfaca303d9e4ee1ec01391301 (patch)
tree5c3ac04d1ebb4bbf8f120d30569df7a1c5ff521b /chrome_frame/policy_settings.h
parentdb9afc2141180923600d998c46ae2afc32453495 (diff)
downloadchromium_src-55604d73d488ecdbfaca303d9e4ee1ec01391301.zip
chromium_src-55604d73d488ecdbfaca303d9e4ee1ec01391301.tar.gz
chromium_src-55604d73d488ecdbfaca303d9e4ee1ec01391301.tar.bz2
Basic policy implementation for Chrome Frame. We read the policy settings on first request and cache them.
In order to refresh the policy settings the browser has to be restarted. Future implementations may support pushing out policy changes without requiring the user to restart the browser. TEST=Use the policy templates to change the default renderer ("Configure the default renderer for Chrome Frame") and relevant exclusion lists. BUG=29349 Review URL: http://codereview.chromium.org/3435004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/policy_settings.h')
-rw-r--r--chrome_frame/policy_settings.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/chrome_frame/policy_settings.h b/chrome_frame/policy_settings.h
new file mode 100644
index 0000000..a4c1267
--- /dev/null
+++ b/chrome_frame/policy_settings.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2010 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_FRAME_POLICY_SETTINGS_H_
+#define CHROME_FRAME_POLICY_SETTINGS_H_
+
+#include <string>
+#include <vector>
+
+// A simple class that reads and caches policy settings for Chrome Frame.
+// TODO(tommi): Support refreshing when new settings are pushed.
+// TODO(tommi): Use Chrome's classes for this (and the notification service).
+class PolicySettings {
+ public:
+ typedef enum RendererForUrl {
+ RENDERER_NOT_SPECIFIED = -1,
+ RENDER_IN_HOST,
+ RENDER_IN_CHROME_FRAME,
+ };
+
+ PolicySettings() : default_renderer_(RENDERER_NOT_SPECIFIED) {
+ RefreshFromRegistry();
+ }
+
+ ~PolicySettings() {
+ }
+
+ RendererForUrl default_renderer() const {
+ return default_renderer_;
+ }
+
+ RendererForUrl GetRendererForUrl(const wchar_t* url);
+
+ protected:
+ // Protected for now since the class is not thread safe.
+ void RefreshFromRegistry();
+
+ protected:
+ RendererForUrl default_renderer_;
+ std::vector<std::wstring> renderer_exclusion_list_;
+};
+
+
+#endif // CHROME_FRAME_POLICY_SETTINGS_H_