| 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/tab_specific_content_settings.h" | 5 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 OnContentAllowed(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); | 495 OnContentAllowed(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); |
| 496 } | 496 } |
| 497 | 497 |
| 498 void TabSpecificContentSettings::OnCameraAccessBlocked() { | 498 void TabSpecificContentSettings::OnCameraAccessBlocked() { |
| 499 OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()); | 499 OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string()); |
| 500 } | 500 } |
| 501 | 501 |
| 502 void TabSpecificContentSettings::OnMIDISysExAccessed( | 502 void TabSpecificContentSettings::OnMIDISysExAccessed( |
| 503 const GURL& requesting_origin) { | 503 const GURL& requesting_origin) { |
| 504 midi_usages_state_.OnPermissionSet(requesting_origin, true); | 504 midi_usages_state_.OnPermissionSet(requesting_origin, true); |
| 505 // TODO(toyoshim): Bubble icon for MIDI is disabled for now. | 505 OnContentAllowed(CONTENT_SETTINGS_TYPE_MIDI_SYSEX); |
| 506 // http://crbug.com/257618 | |
| 507 // OnContentAllowed(CONTENT_SETTINGS_TYPE_MIDI_SYSEX); | |
| 508 } | 506 } |
| 509 | 507 |
| 510 void TabSpecificContentSettings::OnMIDISysExAccessBlocked( | 508 void TabSpecificContentSettings::OnMIDISysExAccessBlocked( |
| 511 const GURL& requesting_origin) { | 509 const GURL& requesting_origin) { |
| 512 midi_usages_state_.OnPermissionSet(requesting_origin, false); | 510 midi_usages_state_.OnPermissionSet(requesting_origin, false); |
| 513 // TODO(toyoshim): Bubble icon for MIDI is disabled for now. | 511 OnContentBlocked(CONTENT_SETTINGS_TYPE_MIDI_SYSEX, std::string()); |
| 514 // http://crbug.com/257618 | |
| 515 // OnContentBlocked(CONTENT_SETTINGS_TYPE_MIDI_SYSEX, std::string()); | |
| 516 } | 512 } |
| 517 | 513 |
| 518 void TabSpecificContentSettings::ClearBlockedContentSettingsExceptForCookies() { | 514 void TabSpecificContentSettings::ClearBlockedContentSettingsExceptForCookies() { |
| 519 for (size_t i = 0; i < arraysize(content_blocked_); ++i) { | 515 for (size_t i = 0; i < arraysize(content_blocked_); ++i) { |
| 520 if (i == CONTENT_SETTINGS_TYPE_COOKIES) | 516 if (i == CONTENT_SETTINGS_TYPE_COOKIES) |
| 521 continue; | 517 continue; |
| 522 blocked_resources_[i].reset(); | 518 blocked_resources_[i].reset(); |
| 523 content_blocked_[i] = false; | 519 content_blocked_[i] = false; |
| 524 content_allowed_[i] = false; | 520 content_allowed_[i] = false; |
| 525 content_blockage_indicated_to_user_[i] = false; | 521 content_blockage_indicated_to_user_[i] = false; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 } | 675 } |
| 680 | 676 |
| 681 void TabSpecificContentSettings::RemoveSiteDataObserver( | 677 void TabSpecificContentSettings::RemoveSiteDataObserver( |
| 682 SiteDataObserver* observer) { | 678 SiteDataObserver* observer) { |
| 683 observer_list_.RemoveObserver(observer); | 679 observer_list_.RemoveObserver(observer); |
| 684 } | 680 } |
| 685 | 681 |
| 686 void TabSpecificContentSettings::NotifySiteDataObservers() { | 682 void TabSpecificContentSettings::NotifySiteDataObservers() { |
| 687 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); | 683 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); |
| 688 } | 684 } |
| OLD | NEW |