1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_WEB_STATE_BLOCKED_POPUP_INFO_H_
6 #define IOS_WEB_WEB_STATE_BLOCKED_POPUP_INFO_H_
8 #import <Foundation/Foundation.h>
10 #include "base/ios/block_types.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "ios/web/public/referrer.h"
17 // Contain all information related to a blocked popup.
18 // TODO(eugenebut): rename to BlockedPopup as it's not an info object anymore.
19 class BlockedPopupInfo
{
21 BlockedPopupInfo(const GURL
& url
,
22 const Referrer
& referrer
,
23 NSString
* window_name
,
24 ProceduralBlock show_popup_handler
);
27 // Returns the URL of the popup that was blocked.
28 const GURL
& url() const { return url_
; }
29 // Returns the Referrer of the URL that was blocked.
30 const Referrer
& referrer() const { return referrer_
; }
31 // Returns the window name of the popup that was blocked.
32 NSString
* window_name() const { return window_name_
; }
33 // Allows the popup by opening the blocked popup window.
34 void ShowPopup() const;
36 BlockedPopupInfo(const BlockedPopupInfo
& blocked_popup_info
);
37 void operator=(const BlockedPopupInfo
& blocked_popup_info
);
41 base::scoped_nsobject
<NSString
> window_name_
;
42 ProceduralBlock show_popup_handler_
;
47 #endif // IOS_WEB_WEB_STATE_BLOCKED_POPUP_INFO_H_