Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 78303005: ContentSettings API should not interact with <webview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits + Added missing file Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 entry_url = entry->GetURL(); 757 entry_url = entry->GetURL();
758 if (settings_details.ptr()->update_all() || 758 if (settings_details.ptr()->update_all() ||
759 // The visible NavigationEntry is the URL in the URL field of a tab. 759 // The visible NavigationEntry is the URL in the URL field of a tab.
760 // Currently this should be matched by the |primary_pattern|. 760 // Currently this should be matched by the |primary_pattern|.
761 settings_details.ptr()->primary_pattern().Matches(entry_url)) { 761 settings_details.ptr()->primary_pattern().Matches(entry_url)) {
762 Profile* profile = 762 Profile* profile =
763 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 763 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
764 RendererContentSettingRules rules; 764 RendererContentSettingRules rules;
765 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), 765 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(),
766 &rules); 766 &rules);
767 Send(new ChromeViewMsg_SetContentSettingRules(rules)); 767 Send(new ChromeViewMsg_SetContentSettingRules(
768 web_contents()->GetRoutingID(), rules));
768 } 769 }
769 } 770 }
770 771
771 void TabSpecificContentSettings::SetPasswordObserver( 772 void TabSpecificContentSettings::SetPasswordObserver(
772 PasswordObserver* observer) { 773 PasswordObserver* observer) {
773 password_observer_ = observer; 774 password_observer_ = observer;
774 } 775 }
775 776
776 void TabSpecificContentSettings::NotifyPasswordObserver() { 777 void TabSpecificContentSettings::NotifyPasswordObserver() {
777 if (password_observer_) 778 if (password_observer_)
778 password_observer_->OnPasswordAction(); 779 password_observer_->OnPasswordAction();
779 } 780 }
780 781
781 void TabSpecificContentSettings::AddSiteDataObserver( 782 void TabSpecificContentSettings::AddSiteDataObserver(
782 SiteDataObserver* observer) { 783 SiteDataObserver* observer) {
783 observer_list_.AddObserver(observer); 784 observer_list_.AddObserver(observer);
784 } 785 }
785 786
786 void TabSpecificContentSettings::RemoveSiteDataObserver( 787 void TabSpecificContentSettings::RemoveSiteDataObserver(
787 SiteDataObserver* observer) { 788 SiteDataObserver* observer) {
788 observer_list_.RemoveObserver(observer); 789 observer_list_.RemoveObserver(observer);
789 } 790 }
790 791
791 void TabSpecificContentSettings::NotifySiteDataObservers() { 792 void TabSpecificContentSettings::NotifySiteDataObservers() {
792 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed()); 793 FOR_EACH_OBSERVER(SiteDataObserver, observer_list_, OnSiteDataAccessed());
793 } 794 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698