OLD | NEW |
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 Loading... |
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) { |
| 69 [static_cast<id<TabGridCommands>>(self.browser->dispatcher()) showTabGrid]; |
| 70 } |
67 } | 71 } |
68 | 72 |
69 @end | 73 @end |
OLD | NEW |