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

Unified Diff: ios/web_view/internal/cwv_web_view.mm

Issue 2935923002: Correctly update CWVWebView properties on state restoration. (Closed)
Patch Set: Factored code to updateTitle Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/internal/cwv_web_view.mm
diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm
index 616defce008771a3198a428a3541eeea3fbfea92..5954eb0dbce5808995a76ce671832fbb176e9254 100644
--- a/ios/web_view/internal/cwv_web_view.mm
+++ b/ios/web_view/internal/cwv_web_view.mm
@@ -87,6 +87,8 @@ NSString* const kSessionStorageKey = @"sessionStorage";
- (void)updateNavigationAvailability;
// Updates the URLs exposed through |lastCommittedURL| and |visibleURL|.
- (void)updateCurrentURLs;
+// Updates |title| property.
+- (void)updateTitle;
@end
@@ -239,7 +241,7 @@ static NSString* gUserAgentProduct = nil;
}
- (void)webStateDidChangeTitle:(web::WebState*)webState {
- self.title = base::SysUTF16ToNSString(_webState->GetTitle());
+ [self updateTitle];
}
- (void)renderProcessGoneForWebState:(web::WebState*)webState {
@@ -373,6 +375,12 @@ static NSString* gUserAgentProduct = nil;
_translationController.webState = _webState.get();
[self addInternalWebViewAsSubview];
+
+ [self updateNavigationAvailability];
+ [self updateCurrentURLs];
+ [self updateTitle];
+ self.loading = NO;
+ self.estimatedProgress = 0.0;
}
// Adds the web view provided by |_webState| as a subview unless it has already.
@@ -398,4 +406,8 @@ static NSString* gUserAgentProduct = nil;
self.visibleURL = net::NSURLWithGURL(_webState->GetVisibleURL());
}
+- (void)updateTitle {
+ self.title = base::SysUTF16ToNSString(_webState->GetTitle());
+}
+
@end
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698