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

Unified Diff: ios/web/web_state/web_state_impl.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 side-by-side diff with in-line comments
Download patch
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 6946a50efbd2326b0b4c49d3258a5a30057ae5cb..ae277c097528f7307d29e80f29ae083b82d3b659 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),
+ opened_by_dom_(params.opened_by_dom),
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]);
@@ -721,6 +720,10 @@
return [web_controller_ webViewProxy];
}
+bool WebStateImpl::IsOpenedByDOM() const {
+ return opened_by_dom_;
+}
+
void WebStateImpl::OnProvisionalNavigationStarted(const GURL& url) {
for (auto& observer : observers_)
observer.ProvisionalNavigationStarted(url);

Powered by Google App Engine
This is Rietveld 408576698