| 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 #ifndef CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/common/web_contents_user_data.h" | 8 #include "chrome/browser/common/web_contents_user_data.h" |
| 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 9 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 10 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 10 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 void GetBlockedContents( | 55 void GetBlockedContents( |
| 56 std::vector<content::WebContents*>* blocked_contents) const; | 56 std::vector<content::WebContents*>* blocked_contents) const; |
| 57 | 57 |
| 58 // content::WebContentsObserver overrides: | 58 // content::WebContentsObserver overrides: |
| 59 virtual void DidNavigateMainFrame( | 59 virtual void DidNavigateMainFrame( |
| 60 const content::LoadCommittedDetails& details, | 60 const content::LoadCommittedDetails& details, |
| 61 const content::FrameNavigateParams& params) OVERRIDE; | 61 const content::FrameNavigateParams& params) OVERRIDE; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 explicit BlockedContentTabHelper(content::WebContents* web_contents); | 64 explicit BlockedContentTabHelper(content::WebContents* web_contents); |
| 65 static int kUserDataKey; | |
| 66 friend class WebContentsUserData<BlockedContentTabHelper>; | 65 friend class WebContentsUserData<BlockedContentTabHelper>; |
| 67 | 66 |
| 68 // Called when the blocked popup notification is shown or hidden. | 67 // Called when the blocked popup notification is shown or hidden. |
| 69 void PopupNotificationVisibilityChanged(bool visible); | 68 void PopupNotificationVisibilityChanged(bool visible); |
| 70 | 69 |
| 71 // Called to notify any observers that |contents| is entering or leaving | 70 // Called to notify any observers that |contents| is entering or leaving |
| 72 // the blocked state. | 71 // the blocked state. |
| 73 void SendNotification(content::WebContents* contents, bool blocked_state); | 72 void SendNotification(content::WebContents* contents, bool blocked_state); |
| 74 | 73 |
| 75 // Object that holds any blocked WebContentses spawned from this WebContents. | 74 // Object that holds any blocked WebContentses spawned from this WebContents. |
| 76 scoped_ptr<BlockedContentContainer> blocked_contents_; | 75 scoped_ptr<BlockedContentContainer> blocked_contents_; |
| 77 | 76 |
| 78 // Should we block all child TabContents this attempts to spawn. | 77 // Should we block all child TabContents this attempts to spawn. |
| 79 bool all_contents_blocked_; | 78 bool all_contents_blocked_; |
| 80 | 79 |
| 81 // Delegate for notifying our owner (usually Browser) about stuff. Not owned | 80 // Delegate for notifying our owner (usually Browser) about stuff. Not owned |
| 82 // by us. | 81 // by us. |
| 83 BlockedContentTabHelperDelegate* delegate_; | 82 BlockedContentTabHelperDelegate* delegate_; |
| 84 | 83 |
| 85 DISALLOW_COPY_AND_ASSIGN(BlockedContentTabHelper); | 84 DISALLOW_COPY_AND_ASSIGN(BlockedContentTabHelper); |
| 86 }; | 85 }; |
| 87 | 86 |
| 88 #endif // CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_H_ | 87 #endif // CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_TAB_HELPER_H_ |
| OLD | NEW |