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

Side by Side Diff: ios/web/public/test/fakes/test_web_state_delegate.mm

Issue 2717613006: Moved ios popup opening code from Tab to BlockedPopupTabHelper. (Closed)
Patch Set: Rebased 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/web/public/test/fakes/test_web_state_delegate.h" 5 #import "ios/web/public/test/fakes/test_web_state_delegate.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 8
9 namespace web { 9 namespace web {
10 10
11 TestOpenURLRequest::TestOpenURLRequest()
12 : params(GURL(),
13 Referrer(),
14 WindowOpenDisposition::UNKNOWN,
15 ui::PAGE_TRANSITION_LINK,
16 false) {}
17
18 TestOpenURLRequest::~TestOpenURLRequest() = default;
19
20 TestOpenURLRequest::TestOpenURLRequest(const TestOpenURLRequest&) = default;
21
11 TestRepostFormRequest::TestRepostFormRequest() {} 22 TestRepostFormRequest::TestRepostFormRequest() {}
12 23
13 TestRepostFormRequest::~TestRepostFormRequest() = default; 24 TestRepostFormRequest::~TestRepostFormRequest() = default;
14 25
15 TestRepostFormRequest::TestRepostFormRequest(const TestRepostFormRequest&) = 26 TestRepostFormRequest::TestRepostFormRequest(const TestRepostFormRequest&) =
16 default; 27 default;
17 28
18 TestAuthenticationRequest::TestAuthenticationRequest() {} 29 TestAuthenticationRequest::TestAuthenticationRequest() {}
19 30
20 TestAuthenticationRequest::~TestAuthenticationRequest() = default; 31 TestAuthenticationRequest::~TestAuthenticationRequest() = default;
21 32
22 TestAuthenticationRequest::TestAuthenticationRequest( 33 TestAuthenticationRequest::TestAuthenticationRequest(
23 const TestAuthenticationRequest&) = default; 34 const TestAuthenticationRequest&) = default;
24 35
25 TestWebStateDelegate::TestWebStateDelegate() {} 36 TestWebStateDelegate::TestWebStateDelegate() {}
26 37
27 TestWebStateDelegate::~TestWebStateDelegate() = default; 38 TestWebStateDelegate::~TestWebStateDelegate() = default;
28 39
40 WebState* TestWebStateDelegate::OpenURLFromWebState(
41 WebState* web_state,
42 const WebState::OpenURLParams& params) {
43 last_open_url_request_ = base::MakeUnique<TestOpenURLRequest>();
44 last_open_url_request_->web_state = web_state;
45 last_open_url_request_->params = params;
46 return nullptr;
47 }
48
29 JavaScriptDialogPresenter* TestWebStateDelegate::GetJavaScriptDialogPresenter( 49 JavaScriptDialogPresenter* TestWebStateDelegate::GetJavaScriptDialogPresenter(
30 WebState*) { 50 WebState*) {
31 get_java_script_dialog_presenter_called_ = true; 51 get_java_script_dialog_presenter_called_ = true;
32 return &java_script_dialog_presenter_; 52 return &java_script_dialog_presenter_;
33 } 53 }
34 54
35 bool TestWebStateDelegate::HandleContextMenu(WebState*, 55 bool TestWebStateDelegate::HandleContextMenu(WebState*,
36 const ContextMenuParams&) { 56 const ContextMenuParams&) {
37 handle_context_menu_called_ = true; 57 handle_context_menu_called_ = true;
38 return NO; 58 return NO;
(...skipping 19 matching lines...) Expand all
58 const AuthCallback& callback) { 78 const AuthCallback& callback) {
59 last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>(); 79 last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>();
60 last_authentication_request_->web_state = source; 80 last_authentication_request_->web_state = source;
61 last_authentication_request_->protection_space.reset( 81 last_authentication_request_->protection_space.reset(
62 [protection_space retain]); 82 [protection_space retain]);
63 last_authentication_request_->credential.reset([credential retain]); 83 last_authentication_request_->credential.reset([credential retain]);
64 last_authentication_request_->auth_callback = callback; 84 last_authentication_request_->auth_callback = callback;
65 } 85 }
66 86
67 } // namespace web 87 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/public/test/fakes/test_web_state_delegate.h ('k') | ios/web/public/test/web_test_with_web_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698