| Index: chrome/browser/ui/content_settings/blocked_content_container.h
|
| diff --git a/chrome/browser/blocked_content_container.h b/chrome/browser/ui/content_settings/blocked_content_container.h
|
| similarity index 66%
|
| rename from chrome/browser/blocked_content_container.h
|
| rename to chrome/browser/ui/content_settings/blocked_content_container.h
|
| index a78e0921df4af36f3d72d7a6a1235881d8d88100..532798e746cda233e5c4ebfcc470c62f21cab5e2 100644
|
| --- a/chrome/browser/blocked_content_container.h
|
| +++ b/chrome/browser/ui/content_settings/blocked_content_container.h
|
| @@ -3,44 +3,63 @@
|
| // 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
|
| +// ContentSettingsTabHelper. Users and subclasses of TabContents/
|
| +// TabContentsWrapper should use the appropriate methods on
|
| +// ContentSettingsTabHelper to access information about blocked content.
|
|
|
| -#ifndef CHROME_BROWSER_BLOCKED_CONTENT_CONTAINER_H_
|
| -#define CHROME_BROWSER_BLOCKED_CONTENT_CONTAINER_H_
|
| +#ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_BLOCKED_CONTENT_CONTAINER_H_
|
| +#define CHROME_BROWSER_UI_CONTENT_SETTINGS_BLOCKED_CONTENT_CONTAINER_H_
|
| #pragma once
|
|
|
| #include <vector>
|
|
|
| +#include "base/compiler_specific.h"
|
| +#include "chrome/browser/ui/content_settings/content_settings_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 ContentSettingsTabHelperDelegate,
|
| + 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();
|
| +
|
| + // Overridden from ContentSettingsTabHelperDelegate:
|
|
|
| - // Sets this object up to delete itself.
|
| - void Destroy();
|
| + // Ignore contents requests from the TabContents we're blocking.
|
| + virtual void ShowContentSettingsPage(ContentSettingsType content_type) {}
|
| + virtual void ShowCollectedCookiesDialog(TabContents* tab_contents) {}
|
| +
|
| + // Overridden from ContentSettingsTabHelperDelegate, TabContentsDelegate:
|
| + virtual TabContents* GetConstrainingContents(TabContents* source) OVERRIDE;
|
| + virtual TabContentsWrapper* GetConstrainingContents(
|
| + TabContentsWrapper* source) OVERRIDE;
|
|
|
| // Overridden from TabContentsDelegate:
|
|
|
| @@ -78,9 +97,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 toolbar.
|
| virtual void ToolbarSizeChanged(TabContents* source, bool is_animating) {}
|
|
|
| @@ -98,7 +114,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_;
|
| @@ -106,4 +122,4 @@ class BlockedContentContainer : public TabContentsDelegate {
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(BlockedContentContainer);
|
| };
|
|
|
| -#endif // CHROME_BROWSER_BLOCKED_CONTENT_CONTAINER_H_
|
| +#endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_BLOCKED_CONTENT_CONTAINER_H_
|
|
|