| OLD | NEW |
| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h" | 7 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" | 10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 [window_ setContentView:border_view]; | 54 [window_ setContentView:border_view]; |
| 55 | 55 |
| 56 view_ = [[[AutofillPopupViewCocoa alloc] | 56 view_ = [[[AutofillPopupViewCocoa alloc] |
| 57 initWithController:controller_ | 57 initWithController:controller_ |
| 58 frame:NSZeroRect] autorelease]; | 58 frame:NSZeroRect] autorelease]; |
| 59 [border_view setContentView:view_]; | 59 [border_view setContentView:view_]; |
| 60 } | 60 } |
| 61 | 61 |
| 62 AutofillPopupViewBridge::~AutofillPopupViewBridge() { | 62 AutofillPopupViewBridge::~AutofillPopupViewBridge() { |
| 63 [view_ controllerDestroyed]; | 63 [view_ controllerDestroyed]; |
| 64 controller_->ViewDestroyed(); | |
| 65 | 64 |
| 66 // Remove the child window before closing, otherwise it can mess up | 65 // Remove the child window before closing, otherwise it can mess up |
| 67 // display ordering. | 66 // display ordering. |
| 68 [[window_ parentWindow] removeChildWindow:window_]; | 67 [[window_ parentWindow] removeChildWindow:window_]; |
| 69 | 68 |
| 70 [window_ close]; | 69 [window_ close]; |
| 71 } | 70 } |
| 72 | 71 |
| 73 void AutofillPopupViewBridge::Hide() { | 72 void AutofillPopupViewBridge::Hide() { |
| 73 AutofillPopupView::Hide(); |
| 74 |
| 74 delete this; | 75 delete this; |
| 75 } | 76 } |
| 76 | 77 |
| 77 void AutofillPopupViewBridge::Show() { | 78 void AutofillPopupViewBridge::Show() { |
| 78 UpdateBoundsAndRedrawPopup(); | 79 UpdateBoundsAndRedrawPopup(); |
| 79 [[controller_->container_view() window] addChildWindow:window_ | 80 [[controller_->container_view() window] addChildWindow:window_ |
| 80 ordered:NSWindowAbove]; | 81 ordered:NSWindowAbove]; |
| 81 } | 82 } |
| 82 | 83 |
| 83 void AutofillPopupViewBridge::InvalidateRow(size_t row) { | 84 void AutofillPopupViewBridge::InvalidateRow(size_t row) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 107 | 108 |
| 108 // TODO(isherman): The view should support scrolling if the popup gets too | 109 // TODO(isherman): The view should support scrolling if the popup gets too |
| 109 // big to fit on the screen. | 110 // big to fit on the screen. |
| 110 [window_ setFrame:frame display:YES]; | 111 [window_ setFrame:frame display:YES]; |
| 111 } | 112 } |
| 112 | 113 |
| 113 AutofillPopupView* AutofillPopupView::Create( | 114 AutofillPopupView* AutofillPopupView::Create( |
| 114 AutofillPopupController* controller) { | 115 AutofillPopupController* controller) { |
| 115 return new AutofillPopupViewBridge(controller); | 116 return new AutofillPopupViewBridge(controller); |
| 116 } | 117 } |
| OLD | NEW |