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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.mm

Issue 12556002: Always Close the Autofill UI through the same path (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Disable Test On Linux Created 7 years, 9 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_view.cc ('k') | chrome/browser/ui/gtk/autofill/autofill_popup_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698