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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 entry_url = entry->GetURL(); | 737 entry_url = entry->GetURL(); |
738 if (settings_details.ptr()->update_all() || | 738 if (settings_details.ptr()->update_all() || |
739 // The visible NavigationEntry is the URL in the URL field of a tab. | 739 // The visible NavigationEntry is the URL in the URL field of a tab. |
740 // Currently this should be matched by the |primary_pattern|. | 740 // Currently this should be matched by the |primary_pattern|. |
741 settings_details.ptr()->primary_pattern().Matches(entry_url)) { | 741 settings_details.ptr()->primary_pattern().Matches(entry_url)) { |
742 Profile* profile = | 742 Profile* profile = |
743 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 743 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
744 RendererContentSettingRules rules; | 744 RendererContentSettingRules rules; |
745 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), | 745 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), |
746 &rules); | 746 &rules); |
747 Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 747 Send(new ChromeViewMsg_SetContentSettingRules( |
| 748 web_contents()->GetRoutingID(), rules)); |
748 } | 749 } |
749 } | 750 } |
750 | 751 |
751 void TabSpecificContentSettings::SetPasswordObserver( | 752 void TabSpecificContentSettings::SetPasswordObserver( |
752 PasswordObserver* observer) { | 753 PasswordObserver* observer) { |
753 password_observer_ = observer; | 754 password_observer_ = observer; |
754 } | 755 } |
755 | 756 |
756 void TabSpecificContentSettings::NotifyPasswordObserver() { | 757 void TabSpecificContentSettings::NotifyPasswordObserver() { |
757 if (password_observer_) | 758 if (password_observer_) |
758 password_observer_->OnPasswordAction(); | 759 password_observer_->OnPasswordAction(); |
759 } | 760 } |
760 | 761 |
761 void TabSpecificContentSettings::AddSiteDataObserver( | 762 void TabSpecificContentSettings::AddSiteDataObserver( |
762 SiteDataObserver* observer) { | 763 SiteDataObserver* observer) { |
763 observer_list_.AddObserver(observer); | 764 observer_list_.AddObserver(observer); |
764 } | 765 } |
765 | 766 |
766 void TabSpecificContentSettings::RemoveSiteDataObserver( | 767 void TabSpecificContentSettings::RemoveSiteDataObserver( |
767 SiteDataObserver* observer) { | 768 SiteDataObserver* observer) { |
768 observer_list_.RemoveObserver(observer); | 769 observer_list_.RemoveObserver(observer); |
769 } | 770 } |
770 | 771 |
771 void TabSpecificContentSettings::NotifySiteDataObservers() { | 772 void TabSpecificContentSettings::NotifySiteDataObservers() { |
772 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); | 773 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); |
773 } | 774 } |
OLD | NEW |