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/ui/blocked_content/blocked_content_tab_helper.h" | 5 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "chrome/browser/content_settings/host_content_settings_map.h" | 8 #include "chrome/browser/content_settings/host_content_settings_map.h" |
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Close blocked popups. | 35 // Close blocked popups. |
36 if (blocked_contents_->GetBlockedContentsCount()) { | 36 if (blocked_contents_->GetBlockedContentsCount()) { |
37 blocked_contents_->Clear(); | 37 blocked_contents_->Clear(); |
38 PopupNotificationVisibilityChanged(false); | 38 PopupNotificationVisibilityChanged(false); |
39 } | 39 } |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 void BlockedContentTabHelper::PopupNotificationVisibilityChanged( | 43 void BlockedContentTabHelper::PopupNotificationVisibilityChanged( |
44 bool visible) { | 44 bool visible) { |
45 if (tab_contents()->is_being_destroyed()) | 45 if (tab_contents()->IsBeingDestroyed()) |
46 return; | 46 return; |
47 tab_contents_wrapper_->content_settings()->SetPopupsBlocked(visible); | 47 tab_contents_wrapper_->content_settings()->SetPopupsBlocked(visible); |
48 } | 48 } |
49 | 49 |
50 void BlockedContentTabHelper::SetAllContentsBlocked(bool value) { | 50 void BlockedContentTabHelper::SetAllContentsBlocked(bool value) { |
51 if (all_contents_blocked_ == value) | 51 if (all_contents_blocked_ == value) |
52 return; | 52 return; |
53 | 53 |
54 all_contents_blocked_ = value; | 54 all_contents_blocked_ = value; |
55 if (!all_contents_blocked_ && blocked_contents_->GetBlockedContentsCount()) { | 55 if (!all_contents_blocked_ && blocked_contents_->GetBlockedContentsCount()) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 size_t BlockedContentTabHelper::GetBlockedContentsCount() const { | 118 size_t BlockedContentTabHelper::GetBlockedContentsCount() const { |
119 return blocked_contents_->GetBlockedContentsCount(); | 119 return blocked_contents_->GetBlockedContentsCount(); |
120 } | 120 } |
121 | 121 |
122 void BlockedContentTabHelper::GetBlockedContents( | 122 void BlockedContentTabHelper::GetBlockedContents( |
123 std::vector<TabContentsWrapper*>* blocked_contents) const { | 123 std::vector<TabContentsWrapper*>* blocked_contents) const { |
124 blocked_contents_->GetBlockedContents(blocked_contents); | 124 blocked_contents_->GetBlockedContents(blocked_contents); |
125 } | 125 } |
OLD | NEW |