| 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 // Defines the public interface for the blocked content (including popup) | 5 // Defines the public interface for the blocked content (including popup) |
| 6 // notifications. This interface should only be used by the | 6 // notifications. This interface should only be used by the |
| 7 // BlockedContentTabHelper. Users and subclasses of TabContents/ | 7 // BlockedContentTabHelper. Users and subclasses of TabContents/ |
| 8 // TabContentsWrapper should use the appropriate methods on | 8 // TabContentsWrapper should use the appropriate methods on |
| 9 // BlockedContentTabHelper to access information about blocked content. | 9 // BlockedContentTabHelper to access information about blocked content. |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 // Forwards OpenURLFromTab to our |owner_|. | 59 // Forwards OpenURLFromTab to our |owner_|. |
| 60 // Deprecated. Please use the two-arguments variant. | 60 // Deprecated. Please use the two-arguments variant. |
| 61 // TODO(adriansc): Remove method once refactoring changed all call sites. | 61 // TODO(adriansc): Remove method once refactoring changed all call sites. |
| 62 virtual TabContents* OpenURLFromTab( | 62 virtual TabContents* OpenURLFromTab( |
| 63 TabContents* source, | 63 TabContents* source, |
| 64 const GURL& url, const GURL& referrer, | 64 const GURL& url, const GURL& referrer, |
| 65 WindowOpenDisposition disposition, | 65 WindowOpenDisposition disposition, |
| 66 content::PageTransition transition) OVERRIDE; | 66 content::PageTransition transition) OVERRIDE; |
| 67 virtual TabContents* OpenURLFromTab(TabContents* source, | 67 virtual TabContents* OpenURLFromTab(TabContents* source, |
| 68 const OpenURLParams& params); | 68 const OpenURLParams& params) OVERRIDE; |
| 69 | 69 |
| 70 // Forwards AddNewContents to our |owner_|. | 70 // Forwards AddNewContents to our |owner_|. |
| 71 virtual void AddNewContents(TabContents* source, | 71 virtual void AddNewContents(TabContents* source, |
| 72 TabContents* new_contents, | 72 TabContents* new_contents, |
| 73 WindowOpenDisposition disposition, | 73 WindowOpenDisposition disposition, |
| 74 const gfx::Rect& initial_position, | 74 const gfx::Rect& initial_position, |
| 75 bool user_gesture); | 75 bool user_gesture) OVERRIDE; |
| 76 | 76 |
| 77 // Removes |source| from our internal list of blocked contents. | 77 // Removes |source| from our internal list of blocked contents. |
| 78 virtual void CloseContents(TabContents* source); | 78 virtual void CloseContents(TabContents* source) OVERRIDE; |
| 79 | 79 |
| 80 // Changes the opening rectangle associated with |source|. | 80 // Changes the opening rectangle associated with |source|. |
| 81 virtual void MoveContents(TabContents* source, const gfx::Rect& new_bounds); | 81 virtual void MoveContents(TabContents* source, |
| 82 const gfx::Rect& new_bounds) OVERRIDE; |
| 82 | 83 |
| 83 virtual bool IsPopupOrPanel(const TabContents* source) const OVERRIDE; | 84 virtual bool IsPopupOrPanel(const TabContents* source) const OVERRIDE; |
| 84 | 85 |
| 85 // Always returns true. | 86 // Always returns true. |
| 86 virtual bool ShouldSuppressDialogs(); | 87 virtual bool ShouldSuppressDialogs() OVERRIDE; |
| 87 | 88 |
| 88 // Maximum number of blocked contents we allow. No page should really need | 89 // Maximum number of blocked contents we allow. No page should really need |
| 89 // this many anyway. If reached it typically means there is a compromised | 90 // this many anyway. If reached it typically means there is a compromised |
| 90 // renderer. | 91 // renderer. |
| 91 static const size_t kImpossibleNumberOfPopups; | 92 static const size_t kImpossibleNumberOfPopups; |
| 92 | 93 |
| 93 private: | 94 private: |
| 94 struct BlockedContent; | 95 struct BlockedContent; |
| 95 | 96 |
| 96 typedef std::vector<BlockedContent> BlockedContents; | 97 typedef std::vector<BlockedContent> BlockedContents; |
| 97 | 98 |
| 98 // The TabContents that owns and constrains this BlockedContentContainer. | 99 // The TabContents that owns and constrains this BlockedContentContainer. |
| 99 TabContentsWrapper* owner_; | 100 TabContentsWrapper* owner_; |
| 100 | 101 |
| 101 // Information about all blocked contents. | 102 // Information about all blocked contents. |
| 102 BlockedContents blocked_contents_; | 103 BlockedContents blocked_contents_; |
| 103 | 104 |
| 104 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockedContentContainer); | 105 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockedContentContainer); |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 #endif // CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_CONTAINER_H_ | 108 #endif // CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_CONTAINER_H_ |
| OLD | NEW |