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

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

Issue 2687303003: Convert some of TabModel logic to WebStateListObservers. (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/tab_model_tab_parenting_observer.h"
6
7 #include "ios/chrome/browser/tab_parenting_global_observer.h"
8 #import "ios/chrome/browser/tabs/legacy_tab_helper.h"
9 #import "ios/chrome/browser/tabs/tab.h"
10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
15 @implementation TabModelTabParentingObserver
16
17 #pragma mark WebStateListObserver
18
19 - (void)webStateList:(WebStateList*)webStateList
20 webStateInserted:(web::WebState*)webState
21 atIndex:(NSUInteger)index {
22 [self parentedWebState:webState];
23 }
24
25 - (void)webStateList:(WebStateList*)webStateList
26 webStateReplaced:(web::WebState*)oldWebState
27 byWebState:(web::WebState*)newWebState
28 atIndex:(NSUInteger)index {
29 [self parentedWebState:newWebState];
30 }
31
32 #pragma mark Private methods
33
34 - (void)parentedWebState:(web::WebState*)webState {
35 TabParentingGlobalObserver::GetInstance()->OnTabParented(webState);
36 Tab* tab = LegacyTabHelper::GetTabForWebState(webState);
37 [tab fetchFavicon];
38 }
39
40 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698