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

Side by Side Diff: ios/clean/chrome/browser/ui/tab_strip/tab_strip_coordinator.mm

Issue 2904053002: [ios] Active web state observer in tab collection. (Closed)
Patch Set: Address comments. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/clean/chrome/browser/ui/tab_strip/tab_strip_coordinator.h" 5 #import "ios/clean/chrome/browser/ui/tab_strip/tab_strip_coordinator.h"
6 6
7 #import "ios/chrome/browser/web_state_list/web_state_list.h" 7 #import "ios/chrome/browser/web_state_list/web_state_list.h"
8 #import "ios/clean/chrome/browser/ui/commands/tab_grid_commands.h"
8 #import "ios/clean/chrome/browser/ui/commands/tab_strip_commands.h" 9 #import "ios/clean/chrome/browser/ui/commands/tab_strip_commands.h"
9 #import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_mediator.h" 10 #import "ios/clean/chrome/browser/ui/tab_collection/tab_collection_mediator.h"
10 #import "ios/clean/chrome/browser/ui/tab_strip/tab_strip_view_controller.h" 11 #import "ios/clean/chrome/browser/ui/tab_strip/tab_strip_view_controller.h"
11 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" 12 #import "ios/shared/chrome/browser/ui/browser_list/browser.h"
12 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" 13 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h"
13 #include "ios/web/public/web_state/web_state.h" 14 #include "ios/web/public/web_state/web_state.h"
14 15
15 #if !defined(__has_feature) || !__has_feature(objc_arc) 16 #if !defined(__has_feature) || !__has_feature(objc_arc)
16 #error "This file requires ARC support." 17 #error "This file requires ARC support."
17 #endif 18 #endif
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 58 }
58 59
59 #pragma mark - TabStripCommands 60 #pragma mark - TabStripCommands
60 61
61 - (void)showTabStripTabAtIndex:(int)index { 62 - (void)showTabStripTabAtIndex:(int)index {
62 self.webStateList.ActivateWebStateAt(index); 63 self.webStateList.ActivateWebStateAt(index);
63 } 64 }
64 65
65 - (void)closeTabStripTabAtIndex:(int)index { 66 - (void)closeTabStripTabAtIndex:(int)index {
66 self.webStateList.CloseWebStateAt(index); 67 self.webStateList.CloseWebStateAt(index);
68 if (self.webStateList.count() == 0) {
marq (ping after 24h) 2017/05/30 11:09:44 if (self.webStateList.empty()) {
edchin 2017/06/01 23:52:29 Done.
69 [static_cast<id<TabGridCommands>>(self.browser->dispatcher()) showTabGrid];
70 }
67 } 71 }
68 72
69 @end 73 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698