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

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

Issue 2755823002: Moved |openedByDOM| to WebState's CreateParams and public interface. (Closed)
Patch Set: . 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/web_state/web_state_impl.h ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/web_state_impl.mm
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm
index 80364f53a2b782c8df092d0dd829151804e40433..4c4f20edb3db92bb2014d816968bcac19444db09 100644
--- a/ios/web/web_state/web_state_impl.mm
+++ b/ios/web/web_state/web_state_impl.mm
@@ -43,12 +43,10 @@
/* static */
std::unique_ptr<WebState> WebState::Create(const CreateParams& params) {
- std::unique_ptr<WebStateImpl> web_state(
- new WebStateImpl(params.browser_state));
+ std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(params));
// Initialize the new session.
- BOOL opened_by_dom = NO;
- web_state->GetNavigationManagerImpl().InitializeSession(opened_by_dom);
+ web_state->GetNavigationManagerImpl().InitializeSession();
// This std::move is required to compile with the version of clang shipping
// with Xcode 8.0+. Evalute whether the issue is fixed once a new version of
@@ -60,7 +58,7 @@
std::unique_ptr<WebState> WebState::Create(const CreateParams& params,
CRWSessionStorage* session_storage) {
std::unique_ptr<WebStateImpl> web_state(
- new WebStateImpl(params.browser_state, session_storage));
+ new WebStateImpl(params, session_storage));
// This std::move is required to compile with the version of clang shipping
// with Xcode 8.0+. Evalute whether the issue is fixed once a new version of
@@ -68,10 +66,10 @@
return std::move(web_state);
}
-WebStateImpl::WebStateImpl(BrowserState* browser_state)
- : WebStateImpl(browser_state, nullptr) {}
+WebStateImpl::WebStateImpl(const CreateParams& params)
+ : WebStateImpl(params, nullptr) {}
-WebStateImpl::WebStateImpl(BrowserState* browser_state,
+WebStateImpl::WebStateImpl(const CreateParams& params,
CRWSessionStorage* session_storage)
: delegate_(nullptr),
is_loading_(false),
@@ -79,6 +77,7 @@
facade_delegate_(nullptr),
web_controller_(nil),
interstitial_(nullptr),
+ created_with_opener_(params.created_with_opener),
weak_factory_(this) {
// Create or deserialize the NavigationManager.
if (session_storage) {
@@ -88,7 +87,7 @@
navigation_manager_.reset(new NavigationManagerImpl());
}
navigation_manager_->SetDelegate(this);
- navigation_manager_->SetBrowserState(browser_state);
+ navigation_manager_->SetBrowserState(params.browser_state);
// Send creation event and create the web controller.
GlobalWebStateEventTracker::GetInstance()->OnWebStateCreated(this);
web_controller_.reset([[CRWWebController alloc] initWithWebState:this]);
@@ -727,6 +726,10 @@
return [web_controller_ webViewProxy];
}
+bool WebStateImpl::HasOpener() const {
+ return created_with_opener_;
+}
+
void WebStateImpl::OnProvisionalNavigationStarted(const GURL& url) {
for (auto& observer : observers_)
observer.ProvisionalNavigationStarted(url);
« no previous file with comments | « ios/web/web_state/web_state_impl.h ('k') | ios/web/web_state/web_state_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698