Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: ios/web/web_state/blocked_popup_info.mm

Issue 988383002: Upstream various ios/web utilities and helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@web-public-upstreaming
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/web_state/blocked_popup_info.mm
diff --git a/ios/web/web_state/blocked_popup_info.mm b/ios/web/web_state/blocked_popup_info.mm
new file mode 100644
index 0000000000000000000000000000000000000000..721d18eeb07511412fad01769b8231fb995fe00e
--- /dev/null
+++ b/ios/web/web_state/blocked_popup_info.mm
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/web/web_state/blocked_popup_info.h"
+
+namespace web {
+
+BlockedPopupInfo::BlockedPopupInfo(const GURL& url,
+ const Referrer& referrer,
+ NSString* window_name,
+ ProceduralBlock show_popup_handler)
+ : url_(url),
+ referrer_(referrer),
+ window_name_([window_name copy]),
+ show_popup_handler_([show_popup_handler copy]){
Eugene But (OOO till 7-30) 2015/03/09 16:17:43 NIT: space before {
+}
+
+BlockedPopupInfo::BlockedPopupInfo(const BlockedPopupInfo& blocked_popup_info)
+ : url_(blocked_popup_info.url_),
+ referrer_(blocked_popup_info.referrer_),
+ window_name_([blocked_popup_info.window_name_ copy]),
+ show_popup_handler_([blocked_popup_info.show_popup_handler_ copy]) {
+}
+
+BlockedPopupInfo::~BlockedPopupInfo() {}
+
+void BlockedPopupInfo::ShowPopup() const {
+ show_popup_handler_();
+}
+
+void BlockedPopupInfo::operator=(const BlockedPopupInfo& blocked_popup_info) {
+ url_ = blocked_popup_info.url_;
+ referrer_ = blocked_popup_info.referrer_;
+ window_name_.reset([blocked_popup_info.window_name_ copy]);
+ show_popup_handler_ = [blocked_popup_info.show_popup_handler_ copy];
+}
+
+} // namespace web

Powered by Google App Engine
This is Rietveld 408576698