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

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

Issue 2644703003: Fix memory management of VoiceSearchBarView. (Closed)
Patch Set: Create => Build, removed broken ARC annotation 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
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 // A single infobar container handles all infobars in all tabs. It keeps 432 // A single infobar container handles all infobars in all tabs. It keeps
433 // track of infobars for current tab (accessed via infobar helper of 433 // track of infobars for current tab (accessed via infobar helper of
434 // the current tab). 434 // the current tab).
435 std::unique_ptr<InfoBarContainerIOS> _infoBarContainer; 435 std::unique_ptr<InfoBarContainerIOS> _infoBarContainer;
436 436
437 // Bridge class to deliver container change notifications to BVC. 437 // Bridge class to deliver container change notifications to BVC.
438 std::unique_ptr<InfoBarContainerDelegateIOS> _infoBarContainerDelegate; 438 std::unique_ptr<InfoBarContainerDelegateIOS> _infoBarContainerDelegate;
439 439
440 // Voice search bar at the bottom of the view overlayed on |_contentArea| 440 // Voice search bar at the bottom of the view overlayed on |_contentArea|
441 // when displaying voice search results. Implementation is not complete. 441 // when displaying voice search results.
442 // See b/7998125.
443 base::scoped_nsprotocol<UIView<VoiceSearchBar>*> _voiceSearchBar; 442 base::scoped_nsprotocol<UIView<VoiceSearchBar>*> _voiceSearchBar;
444 443
445 // The image fetcher used to save images and perform image-based searches. 444 // The image fetcher used to save images and perform image-based searches.
446 std::unique_ptr<web::ImageDataFetcher> _imageFetcher; 445 std::unique_ptr<web::ImageDataFetcher> _imageFetcher;
447 446
448 // Card side swipe view. 447 // Card side swipe view.
449 base::scoped_nsobject<CardSideSwipeView> _sideSwipeView; 448 base::scoped_nsobject<CardSideSwipeView> _sideSwipeView;
450 449
451 // Used to cache value of |hasModeToggleSwitch| if set before the tab strip 450 // Used to cache value of |hasModeToggleSwitch| if set before the tab strip
452 // controller has been created. 451 // controller has been created.
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 } 2285 }
2287 } 2286 }
2288 2287
2289 - (void)ensureVoiceSearchBarCreated { 2288 - (void)ensureVoiceSearchBarCreated {
2290 if (_voiceSearchBar) 2289 if (_voiceSearchBar)
2291 return; 2290 return;
2292 2291
2293 CGFloat width = CGRectGetWidth([[self view] bounds]); 2292 CGFloat width = CGRectGetWidth([[self view] bounds]);
2294 CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight; 2293 CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight;
2295 CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight); 2294 CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight);
2296 _voiceSearchBar.reset(ios::GetChromeBrowserProvider() 2295 _voiceSearchBar.reset([ios::GetChromeBrowserProvider()
2297 ->GetVoiceSearchProvider() 2296 ->GetVoiceSearchProvider()
2298 ->CreateVoiceSearchBar(frame)); 2297 ->BuildVoiceSearchBar(frame) retain]);
2299 [_voiceSearchBar setVoiceSearchBarDelegate:self]; 2298 [_voiceSearchBar setVoiceSearchBarDelegate:self];
2300 [_voiceSearchBar setHidden:YES]; 2299 [_voiceSearchBar setHidden:YES];
2301 [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin | 2300 [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin |
2302 UIViewAutoresizingFlexibleWidth]; 2301 UIViewAutoresizingFlexibleWidth];
2303 [self.view insertSubview:_voiceSearchBar 2302 [self.view insertSubview:_voiceSearchBar
2304 belowSubview:_infoBarContainer->view()]; 2303 belowSubview:_infoBarContainer->view()];
2305 } 2304 }
2306 2305
2307 - (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated { 2306 - (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated {
2308 // Voice search bar exists and is shown/hidden. 2307 // Voice search bar exists and is shown/hidden.
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after
5141 5140
5142 - (UIView*)voiceSearchButton { 5141 - (UIView*)voiceSearchButton {
5143 return _voiceSearchButton; 5142 return _voiceSearchButton;
5144 } 5143 }
5145 5144
5146 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5145 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5147 return [self currentLogoAnimationControllerOwner]; 5146 return [self currentLogoAnimationControllerOwner];
5148 } 5147 }
5149 5148
5150 @end 5149 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698