OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 5 |
6 #include "chrome/browser/content_settings/content_settings_base_provider.h" | 6 #include "chrome/browser/content_settings/content_settings_base_provider.h" |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 ExtendedContentSettings::~ExtendedContentSettings() {} | 40 ExtendedContentSettings::~ExtendedContentSettings() {} |
41 | 41 |
42 BaseProvider::BaseProvider(bool is_incognito) | 42 BaseProvider::BaseProvider(bool is_incognito) |
43 : is_incognito_(is_incognito) { | 43 : is_incognito_(is_incognito) { |
44 } | 44 } |
45 | 45 |
46 BaseProvider::~BaseProvider() {} | 46 BaseProvider::~BaseProvider() {} |
47 | 47 |
| 48 //static |
48 bool BaseProvider::RequiresResourceIdentifier( | 49 bool BaseProvider::RequiresResourceIdentifier( |
49 ContentSettingsType content_type) const { | 50 ContentSettingsType content_type) { |
50 if (CommandLine::ForCurrentProcess()->HasSwitch( | 51 if (CommandLine::ForCurrentProcess()->HasSwitch( |
51 switches::kEnableResourceContentSettings)) { | 52 switches::kEnableResourceContentSettings)) { |
52 return kRequiresResourceIdentifier[content_type]; | 53 return kRequiresResourceIdentifier[content_type]; |
53 } else { | 54 } else { |
54 return false; | 55 return false; |
55 } | 56 } |
56 } | 57 } |
57 | 58 |
58 bool BaseProvider::AllDefault( | 59 bool BaseProvider::AllDefault( |
59 const ExtendedContentSettings& settings) const { | 60 const ExtendedContentSettings& settings) const { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 if (setting == CONTENT_SETTING_ASK && | 247 if (setting == CONTENT_SETTING_ASK && |
247 content_type == CONTENT_SETTINGS_TYPE_PLUGINS && | 248 content_type == CONTENT_SETTINGS_TYPE_PLUGINS && |
248 !CommandLine::ForCurrentProcess()->HasSwitch( | 249 !CommandLine::ForCurrentProcess()->HasSwitch( |
249 switches::kEnableClickToPlay)) { | 250 switches::kEnableClickToPlay)) { |
250 return CONTENT_SETTING_BLOCK; | 251 return CONTENT_SETTING_BLOCK; |
251 } | 252 } |
252 return setting; | 253 return setting; |
253 } | 254 } |
254 | 255 |
255 } // namespace content_settings | 256 } // namespace content_settings |
OLD | NEW |