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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.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: Comments from rsesek. 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
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #import "base/mac/sdk_forward_declarations.h" 10 #import "base/mac/sdk_forward_declarations.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return; 108 return;
109 } 109 }
110 110
111 CreatePopupIfNeeded(); 111 CreatePopupIfNeeded();
112 112
113 NSImage* answerImage = nil; 113 NSImage* answerImage = nil;
114 if (!model_->answer_bitmap().isNull()) { 114 if (!model_->answer_bitmap().isNull()) {
115 answerImage = 115 answerImage =
116 gfx::Image::CreateFrom1xBitmap(model_->answer_bitmap()).CopyNSImage(); 116 gfx::Image::CreateFrom1xBitmap(model_->answer_bitmap()).CopyNSImage();
117 } 117 }
118 [matrix_ setController:[[OmniboxPopupTableController alloc] 118 [matrix_ setController:[[[OmniboxPopupTableController alloc]
119 initWithMatchResults:result 119 initWithMatchResults:result
120 tableView:matrix_ 120 tableView:matrix_
121 popupView:*this 121 popupView:*this
122 answerImage:answerImage]]; 122 answerImage:answerImage] autorelease]];
123 BOOL is_dark_theme = [matrix_ hasDarkTheme]; 123 BOOL is_dark_theme = [matrix_ hasDarkTheme];
124 [matrix_ setSeparator:[OmniboxPopupCell 124 [matrix_ setSeparator:[OmniboxPopupCell
125 createSeparatorStringForDarkTheme:is_dark_theme]]; 125 createSeparatorStringForDarkTheme:is_dark_theme]];
126 126
127 // Update the selection before placing (and displaying) the window. 127 // Update the selection before placing (and displaying) the window.
128 PaintUpdatesNow(); 128 PaintUpdatesNow();
129 129
130 // Calculate the matrix size manually rather than using -sizeToCells 130 // Calculate the matrix size manually rather than using -sizeToCells
131 // because actually resizing the matrix messed up the popup size 131 // because actually resizing the matrix messed up the popup size
132 // animation. 132 // animation.
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return NSImageFromImageSkia( 359 return NSImageFromImageSkia(
360 gfx::CreateVectorIcon(vector_icon_id, kIconSize, icon_color)); 360 gfx::CreateVectorIcon(vector_icon_id, kIconSize, icon_color));
361 } 361 }
362 362
363 void OmniboxPopupViewMac::OpenURLForRow(size_t row, 363 void OmniboxPopupViewMac::OpenURLForRow(size_t row,
364 WindowOpenDisposition disposition) { 364 WindowOpenDisposition disposition) {
365 DCHECK_LT(row, GetResult().size()); 365 DCHECK_LT(row, GetResult().size());
366 omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(), 366 omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(),
367 base::string16(), row); 367 base::string16(), row);
368 } 368 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_popup_matrix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698