| Index: chrome/browser/ui/blocked_content/blocked_content_container.h
|
| diff --git a/chrome/browser/blocked_content_container.h b/chrome/browser/ui/blocked_content/blocked_content_container.h
|
| similarity index 69%
|
| rename from chrome/browser/blocked_content_container.h
|
| rename to chrome/browser/ui/blocked_content/blocked_content_container.h
|
| index 4b057cb6eca8c6b0a60a16ba91a23b6af17ec895..72981704b9179bfc35b13e7e4217d13de9ca85d9 100644
|
| --- a/chrome/browser/blocked_content_container.h
|
| +++ b/chrome/browser/ui/blocked_content/blocked_content_container.h
|
| @@ -3,44 +3,57 @@
|
| // found in the LICENSE file.
|
|
|
| // Defines the public interface for the blocked content (including popup)
|
| -// notifications. This interface should only be used by TabContents. Users and
|
| -// subclasses of TabContents should use the appropriate methods on TabContents
|
| -// to access information about blocked content.
|
| +// notifications. This interface should only be used by the
|
| +// BlockedContentTabHelper. Users and subclasses of TabContents/
|
| +// TabContentsWrapper should use the appropriate methods on
|
| +// BlockedContentTabHelper to access information about blocked content.
|
|
|
| -#ifndef CHROME_BROWSER_BLOCKED_CONTENT_CONTAINER_H_
|
| -#define CHROME_BROWSER_BLOCKED_CONTENT_CONTAINER_H_
|
| +#ifndef CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_CONTAINER_H_
|
| +#define CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_CONTAINER_H_
|
| #pragma once
|
|
|
| #include <vector>
|
|
|
| +#include "base/compiler_specific.h"
|
| +#include "chrome/browser/ui/blocked_content/blocked_content_tab_helper_delegate.h"
|
| #include "content/browser/tab_contents/tab_contents_delegate.h"
|
|
|
| +class TabContents;
|
| +class TabContentsWrapper;
|
| +
|
| // Takes ownership of TabContents that are unrequested popup windows.
|
| -class BlockedContentContainer : public TabContentsDelegate {
|
| +class BlockedContentContainer : public BlockedContentTabHelperDelegate,
|
| + public TabContentsDelegate {
|
| public:
|
| // Creates a container for a certain TabContents:
|
| - explicit BlockedContentContainer(TabContents* owner);
|
| + explicit BlockedContentContainer(TabContentsWrapper* owner);
|
| virtual ~BlockedContentContainer();
|
|
|
| // Adds a TabContents to this container. |bounds| are the window bounds
|
| // requested for the TabContents.
|
| - void AddTabContents(TabContents* tab_contents,
|
| + void AddTabContents(TabContentsWrapper* tab_contents,
|
| WindowOpenDisposition disposition,
|
| const gfx::Rect& bounds,
|
| bool user_gesture);
|
|
|
| // Shows the blocked TabContents |tab_contents|.
|
| - void LaunchForContents(TabContents* tab_contents);
|
| + void LaunchForContents(TabContentsWrapper* tab_contents);
|
|
|
| // Returns the number of blocked contents.
|
| size_t GetBlockedContentsCount() const;
|
|
|
| - // Returns the contained TabContents pointers. |blocked_contents| must be
|
| - // non-NULL.
|
| - void GetBlockedContents(std::vector<TabContents*>* blocked_contents) const;
|
| + // Returns the contained TabContentsWrapper pointers. |blocked_contents| must
|
| + // be non-NULL.
|
| + void GetBlockedContents(
|
| + std::vector<TabContentsWrapper*>* blocked_contents) const;
|
| +
|
| + // Removes all blocked contents.
|
| + void Clear();
|
|
|
| - // Sets this object up to delete itself.
|
| - void Destroy();
|
| + // Overridden from BlockedContentTabHelperDelegate, TabContentsDelegate:
|
| + virtual TabContents* GetConstrainingContents(TabContents* source) OVERRIDE;
|
| + virtual TabContentsWrapper* GetConstrainingContents(
|
| + TabContentsWrapper* source) OVERRIDE;
|
|
|
| // Overridden from TabContentsDelegate:
|
|
|
| @@ -78,9 +91,6 @@ class BlockedContentContainer : public TabContentsDelegate {
|
| // Always returns true.
|
| virtual bool IsPopup(const TabContents* source) const;
|
|
|
| - // Returns our |owner_|.
|
| - virtual TabContents* GetConstrainingContents(TabContents* source);
|
| -
|
| // Ignored; BlockedContentContainer doesn't display a URL bar.
|
| virtual void UpdateTargetURL(TabContents* source, const GURL& url) {}
|
|
|
| @@ -95,7 +105,7 @@ class BlockedContentContainer : public TabContentsDelegate {
|
| typedef std::vector<BlockedContent> BlockedContents;
|
|
|
| // The TabContents that owns and constrains this BlockedContentContainer.
|
| - TabContents* owner_;
|
| + TabContentsWrapper* owner_;
|
|
|
| // Information about all blocked contents.
|
| BlockedContents blocked_contents_;
|
| @@ -103,4 +113,4 @@ class BlockedContentContainer : public TabContentsDelegate {
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(BlockedContentContainer);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_BLOCKED_CONTENT_CONTAINER_H_
|
| +#endif // CHROME_BROWSER_UI_BLOCKED_CONTENT_BLOCKED_CONTENT_CONTAINER_H_
|
|
|