| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |