Home | History | Annotate | Download | only in autofill
      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.
      4 
      5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_
      6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_
      7 
      8 #include <vector>
      9 
     10 #include "base/basictypes.h"
     11 #include "base/compiler_specific.h"
     12 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
     13 
     14 @class AutofillPopupViewCocoa;
     15 @class NSWindow;
     16 
     17 namespace autofill {
     18 
     19 class AutofillPopupController;
     20 
     21 // Mac implementation for AutofillPopupView interface.
     22 // Serves as a bridge to the Objective-C class AutofillPopupViewCocoa which
     23 // actually implements the view.
     24 class AutofillPopupViewBridge : public AutofillPopupView {
     25  public:
     26   explicit AutofillPopupViewBridge(AutofillPopupController* controller);
     27 
     28  private:
     29   virtual ~AutofillPopupViewBridge();
     30 
     31   // AutofillPopupView implementation.
     32   virtual void Hide() OVERRIDE;
     33   virtual void Show() OVERRIDE;
     34   virtual void InvalidateRow(size_t row) OVERRIDE;
     35   virtual void UpdateBoundsAndRedrawPopup() OVERRIDE;
     36 
     37   // Set the initial bounds of the popup to show, including the placement
     38   // of it.
     39   void SetInitialBounds();
     40 
     41   // The controller for this view.
     42   AutofillPopupController* controller_;  // Weak reference.
     43 
     44   // The native Cocoa window and view.
     45   NSWindow* window_;  // Weak reference, owns itself.
     46   AutofillPopupViewCocoa* view_;  // Weak reference, owned by the |window_|.
     47 
     48   DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewBridge);
     49 };
     50 
     51 }  // namespace autofill
     52 
     53 #endif  // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_
     54