Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / autofill / generated_credit_card_bubble_cocoa.h
blobc6c76859baccc20983191c1fbd18865124aa6578
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"
11 #ifdef __OBJC__
12 @class GeneratedCreditCardBubbleControllerCocoa;
13 #else
14 class GeneratedCreditCardBubbleControllerCocoa;
15 #endif
17 namespace autofill {
19 class GeneratedCreditCardBubbleCocoa : public GeneratedCreditCardBubbleView {
20 public:
21 virtual ~GeneratedCreditCardBubbleCocoa();
23 // GeneratedCreditCardBubbleView interface.
24 virtual void Show() OVERRIDE;
25 virtual void Hide() OVERRIDE;
26 virtual bool IsHiding() const OVERRIDE;
28 // Callbacks.
29 void OnBubbleClosing();
30 void OnLinkClicked();
32 base::WeakPtr<GeneratedCreditCardBubbleController> controller() {
33 return controller_;
36 private:
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_