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 "base/mac/scoped_nsobject.h"
     13 #include "chrome/browser/ui/autofill/autofill_popup_view.h"
     14 #include "chrome/browser/ui/cocoa/autofill/autofill_popup_view_cocoa.h"
     15 
     16 @class AutofillPopupViewCocoa;
     17 @class NSWindow;
     18 
     19 namespace autofill {
     20 
     21 class AutofillPopupViewDelegate;
     22 
     23 // Mac implementation of the AutofillPopupView interface.
     24 // Serves as a bridge to an instance of the Objective-C class which actually
     25 // implements the view.
     26 class AutofillPopupViewBridge : public AutofillPopupView {
     27  public:
     28   explicit AutofillPopupViewBridge(AutofillPopupController* controller);
     29 
     30  private:
     31   virtual ~AutofillPopupViewBridge();
     32 
     33   // AutofillPopupView implementation.
     34   virtual void Hide() OVERRIDE;
     35   virtual void Show() OVERRIDE;
     36   virtual void InvalidateRow(size_t row) OVERRIDE;
     37   virtual void UpdateBoundsAndRedrawPopup() OVERRIDE;
     38 
     39   // Set the initial bounds of the popup, including its placement.
     40   void SetInitialBounds();
     41 
     42   // The native Cocoa view.
     43   base::scoped_nsobject<AutofillPopupViewCocoa> view_;
     44 
     45   AutofillPopupController* controller_;  // Weak.
     46 
     47   DISALLOW_COPY_AND_ASSIGN(AutofillPopupViewBridge);
     48 };
     49 
     50 }  // namespace autofill
     51 
     52 #endif  // CHROME_BROWSER_UI_COCOA_AUTOFILL_AUTOFILL_POPUP_VIEW_BRIDGE_H_
     53