Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/chrome/browser/ui/browser_view_controller.h" | 5 #import "ios/chrome/browser/ui/browser_view_controller.h" |
| 6 | 6 |
| 7 #import <AssetsLibrary/AssetsLibrary.h> | 7 #import <AssetsLibrary/AssetsLibrary.h> |
| 8 #import <MobileCoreServices/MobileCoreServices.h> | 8 #import <MobileCoreServices/MobileCoreServices.h> |
| 9 #import <PassKit/PassKit.h> | 9 #import <PassKit/PassKit.h> |
| 10 #import <Photos/Photos.h> | 10 #import <Photos/Photos.h> |
| (...skipping 4456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4467 - (void)tabModel:(TabModel*)model didChangeTab:(Tab*)tab { | 4467 - (void)tabModel:(TabModel*)model didChangeTab:(Tab*)tab { |
| 4468 DCHECK(tab && ([_model indexOfTab:tab] != NSNotFound)); | 4468 DCHECK(tab && ([_model indexOfTab:tab] != NSNotFound)); |
| 4469 if (tab == [_model currentTab]) { | 4469 if (tab == [_model currentTab]) { |
| 4470 [self updateToolbar]; | 4470 [self updateToolbar]; |
| 4471 // Disable contextual search when |tab| is a voice search result tab. | 4471 // Disable contextual search when |tab| is a voice search result tab. |
| 4472 BOOL enableContextualSearch = self.active && !tab.isVoiceSearchResultsTab; | 4472 BOOL enableContextualSearch = self.active && !tab.isVoiceSearchResultsTab; |
| 4473 [_contextualSearchController enableContextualSearch:enableContextualSearch]; | 4473 [_contextualSearchController enableContextualSearch:enableContextualSearch]; |
| 4474 } | 4474 } |
| 4475 } | 4475 } |
| 4476 | 4476 |
| 4477 // Observer method, tab replaced. | |
| 4478 - (void)tabModel:(TabModel*)model | |
| 4479 didReplaceTab:(Tab*)oldTab | |
| 4480 withTab:(Tab*)newTab | |
| 4481 atIndex:(NSUInteger)index { | |
| 4482 // Add |newTab|'s view to the hierarchy if it's the current Tab. | |
|
kkhorimoto
2017/03/28 17:18:14
Do we need the uninstall/install delegate calls he
Eugene But (OOO till 7-30)
2017/03/28 17:30:32
No, uninstalling/installing delegates methods do n
| |
| 4483 if (self.active && model.currentTab == newTab) | |
| 4484 [self displayTab:newTab isNewSelection:NO]; | |
| 4485 } | |
| 4486 | |
| 4477 // A tab has been removed, remove its views from display if necessary. | 4487 // A tab has been removed, remove its views from display if necessary. |
| 4478 - (void)tabModel:(TabModel*)model | 4488 - (void)tabModel:(TabModel*)model |
| 4479 didRemoveTab:(Tab*)tab | 4489 didRemoveTab:(Tab*)tab |
| 4480 atIndex:(NSUInteger)index { | 4490 atIndex:(NSUInteger)index { |
| 4481 // Remove stored native controllers for the tab. | 4491 // Remove stored native controllers for the tab. |
| 4482 [_nativeControllersForTabIDs removeObjectForKey:tab.tabId]; | 4492 [_nativeControllersForTabIDs removeObjectForKey:tab.tabId]; |
| 4483 | 4493 |
| 4484 // Ignore changes while the tab stack view is visible (or while suspended). | 4494 // Ignore changes while the tab stack view is visible (or while suspended). |
| 4485 // The display will be refreshed when this view becomes active again. | 4495 // The display will be refreshed when this view becomes active again. |
| 4486 if (!self.visible || !model.webUsageEnabled) | 4496 if (!self.visible || !model.webUsageEnabled) |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5028 | 5038 |
| 5029 - (UIView*)voiceSearchButton { | 5039 - (UIView*)voiceSearchButton { |
| 5030 return _voiceSearchButton; | 5040 return _voiceSearchButton; |
| 5031 } | 5041 } |
| 5032 | 5042 |
| 5033 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5043 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5034 return [self currentLogoAnimationControllerOwner]; | 5044 return [self currentLogoAnimationControllerOwner]; |
| 5035 } | 5045 } |
| 5036 | 5046 |
| 5037 @end | 5047 @end |
| OLD | NEW |