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

Unified Diff: ios/web/public/test/fakes/test_web_state_delegate.mm

Issue 2737353006: Replaced webPageOrderedClose with WebStateDelegate API. (Closed)
Patch Set: Addressed review comments Created 3 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
« no previous file with comments | « ios/web/public/test/fakes/test_web_state_delegate.h ('k') | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/fakes/test_web_state_delegate.mm
diff --git a/ios/web/public/test/fakes/test_web_state_delegate.mm b/ios/web/public/test/fakes/test_web_state_delegate.mm
index 8263400e0778cacc73ef5c860e9d0ad4795dff76..08fba8d5210e4346a6c066c0cf2bfbc291c29094 100644
--- a/ios/web/public/test/fakes/test_web_state_delegate.mm
+++ b/ios/web/public/test/fakes/test_web_state_delegate.mm
@@ -64,6 +64,20 @@ WebState* TestWebStateDelegate::CreateNewWebState(WebState* source,
return child_windows_.back().get();
}
+void TestWebStateDelegate::CloseWebState(WebState* source) {
+ last_close_web_state_request_ = base::MakeUnique<TestCloseWebStateRequest>();
+ last_close_web_state_request_->web_state = source;
+
+ // Remove WebState from |child_windows_|.
+ for (size_t i = 0; i < child_windows_.size(); i++) {
+ if (child_windows_[i].get() == source) {
+ closed_child_windows_.push_back(std::move(child_windows_[i]));
+ child_windows_.erase(child_windows_.begin() + i);
+ break;
+ }
+ }
+}
+
WebState* TestWebStateDelegate::OpenURLFromWebState(
WebState* web_state,
const WebState::OpenURLParams& params) {
« no previous file with comments | « ios/web/public/test/fakes/test_web_state_delegate.h ('k') | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698