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

Side by Side Diff: chrome/browser/cocoa/location_bar_view_mac.mm

Issue 586009: [Mac] Fix use-after-free when dragging tabs with page-actions.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/307/src/
Patch Set: Created 10 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/location_bar_view_mac.h" 5 #import "chrome/browser/cocoa/location_bar_view_mac.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell]; 99 AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell];
100 [cell setSecurityImageView:&security_image_view_]; 100 [cell setSecurityImageView:&security_image_view_];
101 [cell setPageActionViewList:page_action_views_]; 101 [cell setPageActionViewList:page_action_views_];
102 102
103 registrar_.Add(this, 103 registrar_.Add(this,
104 NotificationType::EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED, 104 NotificationType::EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
105 NotificationService::AllSources()); 105 NotificationService::AllSources());
106 } 106 }
107 107
108 LocationBarViewMac::~LocationBarViewMac() { 108 LocationBarViewMac::~LocationBarViewMac() {
109 // Disconnect from cell in case it outlives us.
110 AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell];
111 [cell setPageActionViewList:NULL];
112 [cell setSecurityImageView:NULL];
113
109 // TODO(shess): Placeholder for omnibox changes. 114 // TODO(shess): Placeholder for omnibox changes.
110 delete page_action_views_; 115 delete page_action_views_;
111 } 116 }
112 117
113 std::wstring LocationBarViewMac::GetInputString() const { 118 std::wstring LocationBarViewMac::GetInputString() const {
114 return location_input_; 119 return location_input_;
115 } 120 }
116 121
117 WindowOpenDisposition LocationBarViewMac::GetWindowOpenDisposition() const { 122 WindowOpenDisposition LocationBarViewMac::GetWindowOpenDisposition() const {
118 return disposition_; 123 return disposition_;
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 if (views_[i]->IsVisible()) 757 if (views_[i]->IsVisible())
753 ++result; 758 ++result;
754 } 759 }
755 return result; 760 return result;
756 } 761 }
757 762
758 void LocationBarViewMac::PageActionViewList::OnMousePressed(NSRect iconFrame, 763 void LocationBarViewMac::PageActionViewList::OnMousePressed(NSRect iconFrame,
759 size_t index) { 764 size_t index) {
760 ViewAt(index)->OnMousePressed(iconFrame); 765 ViewAt(index)->OnMousePressed(iconFrame);
761 } 766 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698