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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2701463002: Fixed title updating for back forward navigation. (Closed)
Patch Set: Created 3 years, 10 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 | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index 06dab25ae5aa3f35e974aa12eb8873ab6fcdf92f..75805cba2a676f1accfe4bcdb3d4c1ce42882681 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -349,10 +349,6 @@ enum class RendererTerminationTabState {
// Sets the favicon on the current NavigationItem.
- (void)setFavicon:(const gfx::Image*)image;
-// Updates the title field of the current session entry. Also updates the
-// history database.
-- (void)updateTitle:(NSString*)title;
-
// Saves the current title to the history database.
- (void)saveTitleToHistoryDB;
@@ -1005,20 +1001,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
overscrollActionsControllerDelegate);
}
-- (void)updateTitle:(NSString*)title {
- web::NavigationItem* item = [self navigationManager]->GetVisibleItem();
- if (!item)
- return;
- item->SetTitle(base::SysNSStringToUTF16(title));
- // TODO(crbug.com/546218): See if this can be removed; it's not clear that
- // other platforms send this (tab sync triggers need to be compared against
- // upstream).
- if (self.webStateImpl)
- self.webStateImpl->GetNavigationManagerImpl().OnNavigationItemChanged();
-
- [self saveTitleToHistoryDB];
-}
-
- (void)saveTitleToHistoryDB {
// If incognito, don't update history.
if (browserState_->IsOffTheRecord())
@@ -1904,13 +1886,8 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
- (void)webController:(CRWWebController*)webController
titleDidChange:(NSString*)title {
- NSString* oldTitle = [self title];
- BOOL isTitleChanged = (!oldTitle && title) || (oldTitle && !title) ||
- (![oldTitle isEqualToString:title]);
- if (isTitleChanged) {
- [self updateTitle:title];
- [parentTabModel_ notifyTabChanged:self];
- }
+ [self saveTitleToHistoryDB];
+ [parentTabModel_ notifyTabChanged:self];
}
- (BOOL)urlTriggersNativeAppLaunch:(const GURL&)url
« no previous file with comments | « no previous file | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698