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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm

Issue 2233123003: Fix many memory leaks in chrome/browser/ui/cocoa/omnibox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a double release. Created 4 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h" 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 contents_ = [CreateClassifiedAttributedString( 458 contents_ = [CreateClassifiedAttributedString(
459 match.contents, ContentTextColor(isDarkTheme), match.contents_class, 459 match.contents, ContentTextColor(isDarkTheme), match.contents_class,
460 isDarkTheme) retain]; 460 isDarkTheme) retain];
461 if (!match.description.empty()) { 461 if (!match.description.empty()) {
462 description_ = [CreateClassifiedAttributedString( 462 description_ = [CreateClassifiedAttributedString(
463 match.description, DimTextColor(isDarkTheme), 463 match.description, DimTextColor(isDarkTheme),
464 match.description_class, isDarkTheme) retain]; 464 match.description_class, isDarkTheme) retain];
465 } 465 }
466 maxLines_ = 1; 466 maxLines_ = 1;
467 } 467 }
468 propertyReleaser_OmniboxPopupCellData_.Init(self,
469 [OmniboxPopupCellData class]);
468 } 470 }
469 return self; 471 return self;
470 } 472 }
471 473
472 - (void)dealloc {
473 [incognitoImage_ release];
474 [super dealloc];
475 }
476
477 - (instancetype)copyWithZone:(NSZone*)zone { 474 - (instancetype)copyWithZone:(NSZone*)zone {
478 return [self retain]; 475 return [self retain];
479 } 476 }
480 477
481 - (CGFloat)getMatchContentsWidth { 478 - (CGFloat)getMatchContentsWidth {
482 return [contents_ size].width; 479 return [contents_ size].width;
483 } 480 }
484 481
485 @end 482 @end
486 483
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 base::string16 raw_separator = 733 base::string16 raw_separator =
737 l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR); 734 l10n_util::GetStringUTF16(IDS_AUTOCOMPLETE_MATCH_DESCRIPTION_SEPARATOR);
738 return CreateAttributedString(raw_separator, DimTextColor(isDarkTheme)); 735 return CreateAttributedString(raw_separator, DimTextColor(isDarkTheme));
739 } 736 }
740 737
741 + (CGFloat)getContentAreaWidth:(NSRect)cellFrame { 738 + (CGFloat)getContentAreaWidth:(NSRect)cellFrame {
742 return NSWidth(cellFrame) - TextStartOffset(); 739 return NSWidth(cellFrame) - TextStartOffset();
743 } 740 }
744 741
745 @end 742 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698