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

Side by Side Diff: components/content_settings/core/browser/content_settings_info.h

Issue 1575623002: Disable Web Notifications in Incognito (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permfix
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_INFO_H_ 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_INFO_H_
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_INFO_H_ 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_INFO_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "components/content_settings/core/common/content_settings.h" 13 #include "components/content_settings/core/common/content_settings.h"
14 14
15 namespace content_settings { 15 namespace content_settings {
16 16
17 class WebsiteSettingsInfo; 17 class WebsiteSettingsInfo;
18 18
19 class ContentSettingsInfo { 19 class ContentSettingsInfo {
20 public: 20 public:
21 enum IncognitoBehavior { 21 enum IncognitoBehavior {
22 // Content setting will be inherited from regular to incognito profiles 22 // Content setting will be inherited from regular to incognito profiles
23 // as usual. 23 // as usual.
24 INHERIT_IN_INCOGNITO, 24 INHERIT_IN_INCOGNITO,
25 25
26 // Content setting will only partially inherit from regular to incognito 26 // Content setting will only partially inherit from regular to incognito
27 // profiles: BLOCK will inherit as usual, but ALLOW will become ASK. 27 // profiles: BLOCK will inherit as usual, but ALLOW will become ASK.
28 // This is unusual, so seek privacy review before using this. 28 // This is unusual, so seek privacy review before using this.
29 INHERIT_IN_INCOGNITO_EXCEPT_ALLOW 29 INHERIT_IN_INCOGNITO_EXCEPT_ALLOW,
30
31 // Content setting is always denied in incognito. However, to prevent sites
32 // from using this setting to detect whether incognito mode is active, this
33 // acts like INHERIT_IN_INCOGNITO_EXCEPT_ALLOW initially, and only denies
34 // the permission once it is requested, after a random time delay that
35 // simulates a user clicking a bubble/infobar.
36 // This is unusual, so seek privacy review before using this.
raymes 2016/01/11 00:41:11 nit: fill previous line (or new paragraph)
johnme 2016/01/11 13:53:52 Done.
37 DENY_IN_INCOGNITO_AFTER_DELAY
30 }; 38 };
31 39
32 // This object does not take ownership of |website_settings_info|. 40 // This object does not take ownership of |website_settings_info|.
33 ContentSettingsInfo(const WebsiteSettingsInfo* website_settings_info, 41 ContentSettingsInfo(const WebsiteSettingsInfo* website_settings_info,
34 const std::vector<std::string>& whitelisted_schemes, 42 const std::vector<std::string>& whitelisted_schemes,
35 const std::set<ContentSetting>& valid_settings, 43 const std::set<ContentSetting>& valid_settings,
36 IncognitoBehavior incognito_behavior); 44 IncognitoBehavior incognito_behavior);
37 ~ContentSettingsInfo(); 45 ~ContentSettingsInfo();
38 46
39 const WebsiteSettingsInfo* website_settings_info() const { 47 const WebsiteSettingsInfo* website_settings_info() const {
(...skipping 12 matching lines...) Expand all
52 const std::vector<std::string> whitelisted_schemes_; 60 const std::vector<std::string> whitelisted_schemes_;
53 const std::set<ContentSetting> valid_settings_; 61 const std::set<ContentSetting> valid_settings_;
54 const IncognitoBehavior incognito_behavior_; 62 const IncognitoBehavior incognito_behavior_;
55 63
56 DISALLOW_COPY_AND_ASSIGN(ContentSettingsInfo); 64 DISALLOW_COPY_AND_ASSIGN(ContentSettingsInfo);
57 }; 65 };
58 66
59 } // namespace content_settings 67 } // namespace content_settings
60 68
61 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_INFO_H_ 69 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_INFO_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698