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

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2644703003: Fix memory management of VoiceSearchBarView. (Closed)
Patch Set: added TODO Created 3 years, 11 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
« no previous file with comments | « no previous file | ios/public/provider/chrome/browser/voice/voice_search_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 428
429 // A single infobar container handles all infobars in all tabs. It keeps 429 // A single infobar container handles all infobars in all tabs. It keeps
430 // track of infobars for current tab (accessed via infobar helper of 430 // track of infobars for current tab (accessed via infobar helper of
431 // the current tab). 431 // the current tab).
432 std::unique_ptr<InfoBarContainerIOS> _infoBarContainer; 432 std::unique_ptr<InfoBarContainerIOS> _infoBarContainer;
433 433
434 // Bridge class to deliver container change notifications to BVC. 434 // Bridge class to deliver container change notifications to BVC.
435 std::unique_ptr<InfoBarContainerDelegateIOS> _infoBarContainerDelegate; 435 std::unique_ptr<InfoBarContainerDelegateIOS> _infoBarContainerDelegate;
436 436
437 // Voice search bar at the bottom of the view overlayed on |_contentArea| 437 // Voice search bar at the bottom of the view overlayed on |_contentArea|
438 // when displaying voice search results. Implementation is not complete. 438 // when displaying voice search results.
439 // See b/7998125.
440 base::scoped_nsprotocol<UIView<VoiceSearchBar>*> _voiceSearchBar; 439 base::scoped_nsprotocol<UIView<VoiceSearchBar>*> _voiceSearchBar;
441 440
442 // The image fetcher used to save images and perform image-based searches. 441 // The image fetcher used to save images and perform image-based searches.
443 std::unique_ptr<web::ImageDataFetcher> _imageFetcher; 442 std::unique_ptr<web::ImageDataFetcher> _imageFetcher;
444 443
445 // Card side swipe view. 444 // Card side swipe view.
446 base::scoped_nsobject<CardSideSwipeView> _sideSwipeView; 445 base::scoped_nsobject<CardSideSwipeView> _sideSwipeView;
447 446
448 // Used to cache value of |hasModeToggleSwitch| if set before the tab strip 447 // Used to cache value of |hasModeToggleSwitch| if set before the tab strip
449 // controller has been created. 448 // controller has been created.
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 } 2282 }
2284 } 2283 }
2285 2284
2286 - (void)ensureVoiceSearchBarCreated { 2285 - (void)ensureVoiceSearchBarCreated {
2287 if (_voiceSearchBar) 2286 if (_voiceSearchBar)
2288 return; 2287 return;
2289 2288
2290 CGFloat width = CGRectGetWidth([[self view] bounds]); 2289 CGFloat width = CGRectGetWidth([[self view] bounds]);
2291 CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight; 2290 CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight;
2292 CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight); 2291 CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight);
2293 _voiceSearchBar.reset(ios::GetChromeBrowserProvider() 2292 _voiceSearchBar.reset([ios::GetChromeBrowserProvider()
2294 ->GetVoiceSearchProvider() 2293 ->GetVoiceSearchProvider()
2295 ->CreateVoiceSearchBar(frame)); 2294 ->BuildVoiceSearchBar(frame) retain]);
rohitrao (ping after 24h) 2017/01/20 14:00:26 We can't change callers to the new API until the d
kkhorimoto 2017/01/24 01:36:18 Moved it to the third of 3-way patch.
2296 [_voiceSearchBar setVoiceSearchBarDelegate:self]; 2295 [_voiceSearchBar setVoiceSearchBarDelegate:self];
2297 [_voiceSearchBar setHidden:YES]; 2296 [_voiceSearchBar setHidden:YES];
2298 [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin | 2297 [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin |
2299 UIViewAutoresizingFlexibleWidth]; 2298 UIViewAutoresizingFlexibleWidth];
2300 [self.view insertSubview:_voiceSearchBar 2299 [self.view insertSubview:_voiceSearchBar
2301 belowSubview:_infoBarContainer->view()]; 2300 belowSubview:_infoBarContainer->view()];
2302 } 2301 }
2303 2302
2304 - (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated { 2303 - (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated {
2305 // Voice search bar exists and is shown/hidden. 2304 // Voice search bar exists and is shown/hidden.
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
5134 5133
5135 - (UIView*)voiceSearchButton { 5134 - (UIView*)voiceSearchButton {
5136 return _voiceSearchButton; 5135 return _voiceSearchButton;
5137 } 5136 }
5138 5137
5139 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5138 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5140 return [self currentLogoAnimationControllerOwner]; 5139 return [self currentLogoAnimationControllerOwner];
5141 } 5140 }
5142 5141
5143 @end 5142 @end
OLDNEW
« no previous file with comments | « no previous file | ios/public/provider/chrome/browser/voice/voice_search_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698