diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 02:53:39 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 02:53:39 +0000 |
commit | 08bc630cdb69b98c193661dc4e81e3ed81ccccff (patch) | |
tree | b247dadb4245e7f4e68a4891adde6226e6bb5da8 /chrome/common/content_settings.h | |
parent | 629a5cd1b524d9677ec217c37e9bcf97e66f4d84 (diff) | |
download | chromium_src-08bc630cdb69b98c193661dc4e81e3ed81ccccff.zip chromium_src-08bc630cdb69b98c193661dc4e81e3ed81ccccff.tar.gz chromium_src-08bc630cdb69b98c193661dc4e81e3ed81ccccff.tar.bz2 |
Rewrite the HostContentSettingsMap to address some issues:
* Interface not well-designed for the actual uses
* Objects in URL request context must be refcounted since Profile is destroyed before the UI thread
BUG=33314
TEST=none
Review URL: http://codereview.chromium.org/555184
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/content_settings.h')
-rw-r--r-- | chrome/common/content_settings.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/common/content_settings.h b/chrome/common/content_settings.h new file mode 100644 index 0000000..59d58c8 --- /dev/null +++ b/chrome/common/content_settings.h @@ -0,0 +1,32 @@ +// 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_COMMON_CONTENT_SETTINGS_H_ +#define CHROME_COMMON_CONTENT_SETTINGS_H_ + +#include "chrome/common/content_settings_types.h" + +// Different settings that can be assigned for a particular content type. We +// give the user the ability to set these on a global and per-host basis. +enum ContentSetting { + CONTENT_SETTING_FIRST_SETTING = 0, + CONTENT_SETTING_DEFAULT = CONTENT_SETTING_FIRST_SETTING, + CONTENT_SETTING_ALLOW, + CONTENT_SETTING_BLOCK, + CONTENT_SETTING_ASK, + CONTENT_SETTING_NUM_SETTINGS +}; + +// Aggregates the permissions for the different content types. +struct ContentSettings { + ContentSettings() { + for (int i = CONTENT_SETTINGS_FIRST_TYPE; i < CONTENT_SETTINGS_NUM_TYPES; + ++i) + settings[i] = CONTENT_SETTING_DEFAULT; + } + + ContentSetting settings[CONTENT_SETTINGS_NUM_TYPES]; +}; + +#endif // CHROME_COMMON_CONTENT_SETTINGS_H_ |