- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / cocoa / autofill / new_credit_card_bubble_cocoa.h
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.
4
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_
7
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"
13
14 #ifdef __OBJC__
15 @class NewCreditCardBubbleControllerCocoa;
16 @class NSWindow;
17 #else
18 class NewCreditCardBubbleControllerCocoa;
19 class NSWindow;
20 }
21 #endif
22
23 namespace autofill {
24
25 class NewCreditCardBubbleController;
26
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 {
30  public:
31   virtual ~NewCreditCardBubbleCocoa();
32
33   // NewCreditCardBubbleView implementation.
34   virtual void Show() OVERRIDE;
35   virtual void Hide() OVERRIDE;
36
37  private:
38   FRIEND_TEST_ALL_PREFIXES(NewCreditCardBubbleCocoaUnitTest, CloseDeletes);
39   friend base::WeakPtr<NewCreditCardBubbleView> NewCreditCardBubbleView::Create(
40       NewCreditCardBubbleController* controller);
41
42   explicit NewCreditCardBubbleCocoa(NewCreditCardBubbleController*);
43
44   // Creates the cocoa bubble controller without initializing anything else.
45   void CreateCocoaController(NSWindow* parent);
46
47   // Cocoa-side controller for the bubble. Not owned.
48   NewCreditCardBubbleControllerCocoa* bubbleController_;
49
50   // Controller that drives this bubble. Never NULL; outlives this class.
51   NewCreditCardBubbleController* controller_;
52
53   base::WeakPtrFactory<NewCreditCardBubbleCocoa> weak_ptr_factory_;
54
55   DISALLOW_COPY_AND_ASSIGN(NewCreditCardBubbleCocoa);
56 };
57
58 }  // namespace auotfill
59
60 #endif  // CHROME_BROWSER_UI_COCOA_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_COCOA_H_