OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 const base::Value* value, ContentSettingsType type) { | 317 const base::Value* value, ContentSettingsType type) { |
318 return IsSettingAllowedForType( | 318 return IsSettingAllowedForType( |
319 content_settings::ValueToContentSetting(value), type); | 319 content_settings::ValueToContentSetting(value), type); |
320 } | 320 } |
321 | 321 |
322 // static | 322 // static |
323 bool HostContentSettingsMap::IsSettingAllowedForType( | 323 bool HostContentSettingsMap::IsSettingAllowedForType( |
324 ContentSetting setting, ContentSettingsType content_type) { | 324 ContentSetting setting, ContentSettingsType content_type) { |
325 // Intents content settings are hidden behind a switch for now. | 325 // Intents content settings are hidden behind a switch for now. |
326 if (content_type == CONTENT_SETTINGS_TYPE_INTENTS) { | 326 if (content_type == CONTENT_SETTINGS_TYPE_INTENTS) { |
327 #if defined(ENABLE_WEB_INTENTS) | |
328 if (!web_intents::IsWebIntentsEnabledInActiveBrowser()) | 327 if (!web_intents::IsWebIntentsEnabledInActiveBrowser()) |
329 return false; | 328 return false; |
330 #else | |
331 return false; | |
332 #endif | |
333 } | 329 } |
334 | 330 |
335 // BLOCK semantics are not implemented for fullscreen. | 331 // BLOCK semantics are not implemented for fullscreen. |
336 if (content_type == CONTENT_SETTINGS_TYPE_FULLSCREEN && | 332 if (content_type == CONTENT_SETTINGS_TYPE_FULLSCREEN && |
337 setting == CONTENT_SETTING_BLOCK) { | 333 setting == CONTENT_SETTING_BLOCK) { |
338 return false; | 334 return false; |
339 } | 335 } |
340 | 336 |
341 // DEFAULT, ALLOW and BLOCK are always allowed. | 337 // DEFAULT, ALLOW and BLOCK are always allowed. |
342 if (setting == CONTENT_SETTING_DEFAULT || | 338 if (setting == CONTENT_SETTING_DEFAULT || |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 467 } |
472 } | 468 } |
473 | 469 |
474 if (info) { | 470 if (info) { |
475 info->source = content_settings::SETTING_SOURCE_NONE; | 471 info->source = content_settings::SETTING_SOURCE_NONE; |
476 info->primary_pattern = ContentSettingsPattern(); | 472 info->primary_pattern = ContentSettingsPattern(); |
477 info->secondary_pattern = ContentSettingsPattern(); | 473 info->secondary_pattern = ContentSettingsPattern(); |
478 } | 474 } |
479 return NULL; | 475 return NULL; |
480 } | 476 } |
OLD | NEW |