| 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() { |
| 74 delete this; | 73 delete this; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 106 |
| 108 // TODO(isherman): The view should support scrolling if the popup gets too | 107 // TODO(isherman): The view should support scrolling if the popup gets too |
| 109 // big to fit on the screen. | 108 // big to fit on the screen. |
| 110 [window_ setFrame:frame display:YES]; | 109 [window_ setFrame:frame display:YES]; |
| 111 } | 110 } |
| 112 | 111 |
| 113 AutofillPopupView* AutofillPopupView::Create( | 112 AutofillPopupView* AutofillPopupView::Create( |
| 114 AutofillPopupController* controller) { | 113 AutofillPopupController* controller) { |
| 115 return new AutofillPopupViewBridge(controller); | 114 return new AutofillPopupViewBridge(controller); |
| 116 } | 115 } |
| OLD | NEW |