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

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

Issue 2755823002: Moved |openedByDOM| to WebState's CreateParams and public interface. (Closed)
Patch Set: BVC session controller cleanup 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 #import "ios/web/web_state/web_state_impl.h" 8 #import "ios/web/web_state/web_state_impl.h"
Eugene But (OOO till 7-30) 2017/03/16 15:31:19 Is this include still needed?
kkhorimoto 2017/03/17 23:04:49 Done.
9 9
10 namespace web { 10 namespace web {
11 11
12 TestOpenURLRequest::TestOpenURLRequest() 12 TestOpenURLRequest::TestOpenURLRequest()
13 : params(GURL(), 13 : params(GURL(),
14 Referrer(), 14 Referrer(),
15 WindowOpenDisposition::UNKNOWN, 15 WindowOpenDisposition::UNKNOWN,
16 ui::PAGE_TRANSITION_LINK, 16 ui::PAGE_TRANSITION_LINK,
17 false) {} 17 false) {}
18 18
(...skipping 29 matching lines...) Expand all
48 last_create_new_web_state_request_->url = url; 48 last_create_new_web_state_request_->url = url;
49 last_create_new_web_state_request_->opener_url = opener_url; 49 last_create_new_web_state_request_->opener_url = opener_url;
50 last_create_new_web_state_request_->initiated_by_user = initiated_by_user; 50 last_create_new_web_state_request_->initiated_by_user = initiated_by_user;
51 51
52 if (!initiated_by_user && 52 if (!initiated_by_user &&
53 allowed_popups_.find(opener_url) == allowed_popups_.end()) { 53 allowed_popups_.find(opener_url) == allowed_popups_.end()) {
54 popups_.push_back(TestPopup(url, opener_url)); 54 popups_.push_back(TestPopup(url, opener_url));
55 return nullptr; 55 return nullptr;
56 } 56 }
57 57
58 std::unique_ptr<WebStateImpl> child( 58 web::WebState::CreateParams params(source->GetBrowserState());
59 base::MakeUnique<WebStateImpl>(source->GetBrowserState())); 59 params.opened_by_dom = true;
60 child->GetNavigationManagerImpl().InitializeSession(YES /*opened_by_dom*/); 60 std::unique_ptr<web::WebState> child = web::WebState::Create(params);
61 child->SetWebUsageEnabled(true); 61 child->SetWebUsageEnabled(true);
62 62
63 child_windows_.push_back(std::move(child)); 63 child_windows_.push_back(std::move(child));
64 return child_windows_.back().get(); 64 return child_windows_.back().get();
65 } 65 }
66 66
67 void TestWebStateDelegate::CloseWebState(WebState* source) { 67 void TestWebStateDelegate::CloseWebState(WebState* source) {
68 last_close_web_state_request_ = base::MakeUnique<TestCloseWebStateRequest>(); 68 last_close_web_state_request_ = base::MakeUnique<TestCloseWebStateRequest>();
69 last_close_web_state_request_->web_state = source; 69 last_close_web_state_request_->web_state = source;
70 70
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 const AuthCallback& callback) { 119 const AuthCallback& callback) {
120 last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>(); 120 last_authentication_request_ = base::MakeUnique<TestAuthenticationRequest>();
121 last_authentication_request_->web_state = source; 121 last_authentication_request_->web_state = source;
122 last_authentication_request_->protection_space.reset( 122 last_authentication_request_->protection_space.reset(
123 [protection_space retain]); 123 [protection_space retain]);
124 last_authentication_request_->credential.reset([credential retain]); 124 last_authentication_request_->credential.reset([credential retain]);
125 last_authentication_request_->auth_callback = callback; 125 last_authentication_request_->auth_callback = callback;
126 } 126 }
127 127
128 } // namespace web 128 } // namespace web
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698