Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / autofill_popup_view_bridge.mm
blobce87e6b7cd799aaa6bd1bb33ed0cad5f2dca85df
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
3 // found in the LICENSE file.
5 #import <Cocoa/Cocoa.h>
7 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_bridge.h"
9 #include "base/logging.h"
10 #include "chrome/browser/ui/autofill/autofill_popup_controller.h"
11 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
12 #import "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h"
13 #include "ui/gfx/geometry/rect.h"
15 namespace autofill {
17 AutofillPopupViewBridge::AutofillPopupViewBridge(
18     AutofillPopupController* controller)
19     : controller_(controller) {
20   view_.reset(
21       [[AutofillPopupViewCocoa alloc] initWithController:controller
22                                                    frame:NSZeroRect]);
25 AutofillPopupViewBridge::~AutofillPopupViewBridge() {
26   [view_ controllerDestroyed];
27   [view_ hidePopup];
30 void AutofillPopupViewBridge::Hide() {
31   delete this;
34 void AutofillPopupViewBridge::Show() {
35   [view_ showPopup];
38 void AutofillPopupViewBridge::InvalidateRow(size_t row) {
39   [view_ invalidateRow:row];
42 void AutofillPopupViewBridge::UpdateBoundsAndRedrawPopup() {
43   [view_ updateBoundsAndRedrawPopup];
46 AutofillPopupView* AutofillPopupView::Create(
47     AutofillPopupController* controller) {
48   return new AutofillPopupViewBridge(controller);
51 }  // namespace autofill