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

Side by Side Diff: ios/chrome/browser/tabs/legacy_tab_helper.mm

Issue 2681843002: Add mechanism to get the Tab from the associated WebState. (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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "ios/chrome/browser/tabs/legacy_tab_helper.h"
6
7 #import "ios/chrome/browser/tabs/tab.h"
8
9 DEFINE_WEB_STATE_USER_DATA_KEY(LegacyTabHelper);
10
11 // static
12 void LegacyTabHelper::CreateForWebState(web::WebState* web_state, Tab* tab) {
13 DCHECK(web_state);
14 DCHECK(!FromWebState(web_state));
15 web_state->SetUserData(UserDataKey(), new LegacyTabHelper(web_state, tab));
16 }
17
18 LegacyTabHelper::~LegacyTabHelper() = default;
19
20 LegacyTabHelper::LegacyTabHelper(web::WebState* web_state, Tab* tab)
21 : tab_(tab) {
22 DCHECK_EQ(web_state, tab.webState);
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698