1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_COCOA_AUTOFILL_GENERATED_CREDIT_CARD_BUBBLE_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_GENERATED_CREDIT_CARD_BUBBLE_COCOA_H_
8 #include "base/mac/scoped_nsobject.h"
9 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_view.h"
12 @
class GeneratedCreditCardBubbleControllerCocoa
;
14 class GeneratedCreditCardBubbleControllerCocoa
;
19 class GeneratedCreditCardBubbleCocoa
: public GeneratedCreditCardBubbleView
{
21 virtual ~GeneratedCreditCardBubbleCocoa();
23 // GeneratedCreditCardBubbleView interface.
24 virtual void Show() OVERRIDE
;
25 virtual void Hide() OVERRIDE
;
26 virtual bool IsHiding() const OVERRIDE
;
29 void OnBubbleClosing();
32 base::WeakPtr
<GeneratedCreditCardBubbleController
> controller() {
37 explicit GeneratedCreditCardBubbleCocoa(
38 const base::WeakPtr
<GeneratedCreditCardBubbleController
>& controller
);
39 friend base::WeakPtr
<GeneratedCreditCardBubbleView
>
40 GeneratedCreditCardBubbleView::Create(
41 const base::WeakPtr
<GeneratedCreditCardBubbleController
>& controller
);
43 // Cocoa-side controller for the bubble. Not owned.
44 GeneratedCreditCardBubbleControllerCocoa
* bubbleController_
;
46 // Controller that drives this bubble. May be invalid when hiding.
47 base::WeakPtr
<GeneratedCreditCardBubbleController
> controller_
;
49 // Factory to vend WeakPtr's to |this|.
50 base::WeakPtrFactory
<GeneratedCreditCardBubbleCocoa
> weak_ptr_factory_
;
52 DISALLOW_COPY_AND_ASSIGN(GeneratedCreditCardBubbleCocoa
);
55 } // namespace autofill
57 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_GENERATED_CREDIT_CARD_BUBBLE_COCOA_H_