Chromium Code Reviews| Index: ios/chrome/browser/tabs/tab.mm |
| diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm |
| index a89e1750b938e636d751186ede1a7893909171e1..a19211713f79e0d7bafd3b2d8bd94cf8c907910e 100644 |
| --- a/ios/chrome/browser/tabs/tab.mm |
| +++ b/ios/chrome/browser/tabs/tab.mm |
| @@ -100,6 +100,7 @@ |
| #import "ios/chrome/browser/web/navigation_manager_util.h" |
| #import "ios/chrome/browser/web/passkit_dialog_provider.h" |
| #include "ios/chrome/browser/web/print_observer.h" |
| +#import "ios/chrome/browser/web/tab_id_tab_helper.h" |
| #include "ios/chrome/grit/ios_strings.h" |
| #import "ios/web/navigation/navigation_item_impl.h" |
| #import "ios/web/navigation/navigation_manager_impl.h" |
| @@ -154,10 +155,6 @@ class TabHistoryContext; |
| class FaviconDriverObserverBridge; |
| class TabInfoBarObserver; |
| -// The key under which the Tab ID is stored in the WebState's serializable user |
| -// data. |
| -NSString* const kTabIDKey = @"TabID"; |
| - |
| // Name of histogram for recording the state of the tab when the renderer is |
| // terminated. |
| const char kRendererTerminationStateHistogram[] = |
| @@ -425,7 +422,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
| @implementation Tab |
| @synthesize browserState = _browserState; |
| -@synthesize tabId = tabId_; |
| @synthesize useGreyImageCache = useGreyImageCache_; |
| @synthesize isPrerenderTab = _isPrerenderTab; |
| @synthesize isLinkLoadingPrerenderTab = isLinkLoadingPrerenderTab_; |
| @@ -614,22 +610,7 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
| // tabId should be nil. |
| return nil; |
| } |
| - |
| - if (tabId_) |
| - return tabId_; |
| - |
| - web::SerializableUserDataManager* userDataManager = |
| - web::SerializableUserDataManager::FromWebState(self.webState); |
| - NSString* tabId = base::mac::ObjCCast<NSString>( |
| - userDataManager->GetValueForSerializationKey(kTabIDKey)); |
| - |
| - if (!tabId || ![tabId length]) { |
| - tabId = [[NSUUID UUID] UUIDString]; |
| - userDataManager->AddSerializableData(tabId, kTabIDKey); |
| - } |
| - |
| - tabId_ = [tabId copy]; |
| - return tabId_; |
| + return TabIDTabHelper::FromWebState(self.webState)->tab_id(); |
|
sdefresne
2017/06/26 10:28:55
Since tab_id() method is not virtual, this will le
edchin
2017/06/26 16:20:57
Done.
|
| } |
| - (web::WebState*)webState { |