| 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 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" | 5 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" |
| 6 | 6 |
| 7 #include "app/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #include "base/gfx/rect.h" | 9 #include "base/gfx/rect.h" |
| 10 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 10 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 @implementation AutocompleteMatrixTarget | 587 @implementation AutocompleteMatrixTarget |
| 588 | 588 |
| 589 - initWithPopupView:(AutocompletePopupViewMac*)view { | 589 - initWithPopupView:(AutocompletePopupViewMac*)view { |
| 590 self = [super init]; | 590 self = [super init]; |
| 591 if (self) { | 591 if (self) { |
| 592 popup_view_ = view; | 592 popup_view_ = view; |
| 593 } | 593 } |
| 594 return self; | 594 return self; |
| 595 } | 595 } |
| 596 | 596 |
| 597 - (void)dealloc { |
| 598 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 599 [super dealloc]; |
| 600 } |
| 601 |
| 597 - (void)select:sender { | 602 - (void)select:sender { |
| 598 DCHECK(popup_view_); | 603 DCHECK(popup_view_); |
| 599 popup_view_->AcceptInput(); | 604 popup_view_->AcceptInput(); |
| 600 } | 605 } |
| 601 | 606 |
| 602 - (void)windowDidResize:(NSNotification*)notification { | 607 - (void)windowDidResize:(NSNotification*)notification { |
| 603 DCHECK(popup_view_); | 608 DCHECK(popup_view_); |
| 604 | 609 |
| 605 // TODO(shess): UpdatePopupAppearance() is called frequently, so it | 610 // TODO(shess): UpdatePopupAppearance() is called frequently, so it |
| 606 // should be really cheap, but in this case we could probably make | 611 // should be really cheap, but in this case we could probably make |
| 607 // things even cheaper by refactoring between the popup-placement | 612 // things even cheaper by refactoring between the popup-placement |
| 608 // code and the matrix-population code. | 613 // code and the matrix-population code. |
| 609 popup_view_->UpdatePopupAppearance(); | 614 popup_view_->UpdatePopupAppearance(); |
| 610 } | 615 } |
| 611 | 616 |
| 612 @end | 617 @end |
| OLD | NEW |