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_NEW_CREDIT_CARD_BUBBLE_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_COCOA_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/gtest_prod_util.h"
11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/ui/autofill/new_credit_card_bubble_view.h"
15 @class NewCreditCardBubbleControllerCocoa;
18 class NewCreditCardBubbleControllerCocoa;
25 class NewCreditCardBubbleController;
27 // Cocoa implementation of NewCreditCardBubbleView (a bubble shown after a user
28 // saved a new credit card locally in Chrome).
29 class NewCreditCardBubbleCocoa : public NewCreditCardBubbleView {
31 virtual ~NewCreditCardBubbleCocoa();
33 // NewCreditCardBubbleView implementation.
34 virtual void Show() OVERRIDE;
35 virtual void Hide() OVERRIDE;
38 FRIEND_TEST_ALL_PREFIXES(NewCreditCardBubbleCocoaUnitTest, CloseDeletes);
39 friend base::WeakPtr<NewCreditCardBubbleView> NewCreditCardBubbleView::Create(
40 NewCreditCardBubbleController* controller);
42 explicit NewCreditCardBubbleCocoa(NewCreditCardBubbleController*);
44 // Creates the cocoa bubble controller without initializing anything else.
45 void CreateCocoaController(NSWindow* parent);
47 // Cocoa-side controller for the bubble. Not owned.
48 NewCreditCardBubbleControllerCocoa* bubbleController_;
50 // Controller that drives this bubble. Never NULL; outlives this class.
51 NewCreditCardBubbleController* controller_;
53 base::WeakPtrFactory<NewCreditCardBubbleCocoa> weak_ptr_factory_;
55 DISALLOW_COPY_AND_ASSIGN(NewCreditCardBubbleCocoa);
58 } // namespace auotfill
60 #endif // CHROME_BROWSER_UI_COCOA_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_COCOA_H_