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 #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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // DEFAULT, ALLOW and BLOCK are always allowed. | 319 // DEFAULT, ALLOW and BLOCK are always allowed. |
320 if (setting == CONTENT_SETTING_DEFAULT || | 320 if (setting == CONTENT_SETTING_DEFAULT || |
321 setting == CONTENT_SETTING_ALLOW || | 321 setting == CONTENT_SETTING_ALLOW || |
322 setting == CONTENT_SETTING_BLOCK) { | 322 setting == CONTENT_SETTING_BLOCK) { |
323 return true; | 323 return true; |
324 } | 324 } |
325 switch (content_type) { | 325 switch (content_type) { |
326 case CONTENT_SETTINGS_TYPE_COOKIES: | 326 case CONTENT_SETTINGS_TYPE_COOKIES: |
327 return setting == CONTENT_SETTING_SESSION_ONLY; | 327 return setting == CONTENT_SETTING_SESSION_ONLY; |
328 case CONTENT_SETTINGS_TYPE_PLUGINS: | 328 case CONTENT_SETTINGS_TYPE_PLUGINS: |
329 return setting == CONTENT_SETTING_ASK && | |
330 CommandLine::ForCurrentProcess()->HasSwitch( | |
331 switches::kEnableClickToPlay); | |
332 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 329 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
333 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 330 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
334 case CONTENT_SETTINGS_TYPE_INTENTS: | 331 case CONTENT_SETTINGS_TYPE_INTENTS: |
335 case CONTENT_SETTINGS_TYPE_MOUSELOCK: | 332 case CONTENT_SETTINGS_TYPE_MOUSELOCK: |
336 return setting == CONTENT_SETTING_ASK; | 333 return setting == CONTENT_SETTING_ASK; |
337 default: | 334 default: |
338 return false; | 335 return false; |
339 } | 336 } |
340 } | 337 } |
341 | 338 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 } | 448 } |
452 } | 449 } |
453 | 450 |
454 if (info) { | 451 if (info) { |
455 info->source = content_settings::SETTING_SOURCE_NONE; | 452 info->source = content_settings::SETTING_SOURCE_NONE; |
456 info->primary_pattern = ContentSettingsPattern(); | 453 info->primary_pattern = ContentSettingsPattern(); |
457 info->secondary_pattern = ContentSettingsPattern(); | 454 info->secondary_pattern = ContentSettingsPattern(); |
458 } | 455 } |
459 return NULL; | 456 return NULL; |
460 } | 457 } |
OLD | NEW |