| 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/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" |
| 11 #include "chrome/browser/ui/blocked_content/blocked_content_container.h" | 11 #include "chrome/browser/ui/blocked_content/blocked_content_container.h" |
| 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
| 14 #include "content/public/browser/navigation_controller.h" | 14 #include "content/public/browser/navigation_controller.h" |
| 15 #include "content/public/browser/navigation_details.h" | 15 #include "content/public/browser/navigation_details.h" |
| 16 #include "content/public/browser/navigation_entry.h" | 16 #include "content/public/browser/navigation_entry.h" |
| 17 #include "content/public/browser/notification_details.h" | 17 #include "content/public/browser/notification_details.h" |
| 18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
| 20 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
| 21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "content/public/browser/web_contents_delegate.h" | 22 #include "content/public/browser/web_contents_delegate.h" |
| 23 | 23 |
| 24 using content::NavigationEntry; | 24 using content::NavigationEntry; |
| 25 | 25 |
| 26 int BlockedContentTabHelper::kUserDataKey; | 26 DEFINE_WEB_CONTENTS_USER_DATA_KEY(BlockedContentTabHelper) |
| 27 | 27 |
| 28 BlockedContentTabHelper::BlockedContentTabHelper( | 28 BlockedContentTabHelper::BlockedContentTabHelper( |
| 29 content::WebContents* web_contents) | 29 content::WebContents* web_contents) |
| 30 : content::WebContentsObserver(web_contents), | 30 : content::WebContentsObserver(web_contents), |
| 31 blocked_contents_(new BlockedContentContainer(web_contents)), | 31 blocked_contents_(new BlockedContentContainer(web_contents)), |
| 32 all_contents_blocked_(false), | 32 all_contents_blocked_(false), |
| 33 delegate_(NULL) { | 33 delegate_(NULL) { |
| 34 } | 34 } |
| 35 | 35 |
| 36 BlockedContentTabHelper::~BlockedContentTabHelper() { | 36 BlockedContentTabHelper::~BlockedContentTabHelper() { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 size_t BlockedContentTabHelper::GetBlockedContentsCount() const { | 149 size_t BlockedContentTabHelper::GetBlockedContentsCount() const { |
| 150 return blocked_contents_->GetBlockedContentsCount(); | 150 return blocked_contents_->GetBlockedContentsCount(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void BlockedContentTabHelper::GetBlockedContents( | 153 void BlockedContentTabHelper::GetBlockedContents( |
| 154 std::vector<content::WebContents*>* blocked_contents) const { | 154 std::vector<content::WebContents*>* blocked_contents) const { |
| 155 blocked_contents_->GetBlockedContents(blocked_contents); | 155 blocked_contents_->GetBlockedContents(blocked_contents); |
| 156 } | 156 } |
| OLD | NEW |