OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ |
7 | 7 |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "chrome/browser/infobars/infobar.h" | 9 #include "chrome/browser/infobars/infobar.h" |
10 | 10 |
11 @class InfoBarController; | 11 @class InfoBarController; |
12 | 12 |
13 // The cocoa specific implementation of InfoBar. The real info bar logic is | 13 // The cocoa specific implementation of InfoBar. The real info bar logic is |
14 // actually in InfoBarController. | 14 // actually in InfoBarController. |
15 class InfoBarCocoa : public InfoBar { | 15 class InfoBarCocoa : public InfoBar { |
16 public: | 16 public: |
17 InfoBarCocoa(InfoBarService* owner, InfoBarDelegate* delegate); | 17 explicit InfoBarCocoa(scoped_ptr<InfoBarDelegate> delegate); |
18 | 18 |
19 virtual ~InfoBarCocoa(); | 19 virtual ~InfoBarCocoa(); |
20 | 20 |
21 InfoBarController* controller() const { return controller_; } | 21 InfoBarController* controller() const { return controller_; } |
22 | 22 |
23 void set_controller(InfoBarController* controller) { | 23 void set_controller(InfoBarController* controller) { |
24 controller_.reset([controller retain]); | 24 controller_.reset([controller retain]); |
25 } | 25 } |
26 | 26 |
27 // These functions allow access to protected InfoBar functions. | 27 // These functions allow access to protected InfoBar functions. |
28 void RemoveSelfCocoa(); | |
29 InfoBarService* OwnerCocoa(); | 28 InfoBarService* OwnerCocoa(); |
30 | 29 |
31 private: | 30 private: |
32 // The Objective-C class that contains most of the info bar logic. | 31 // The Objective-C class that contains most of the info bar logic. |
33 base::scoped_nsobject<InfoBarController> controller_; | 32 base::scoped_nsobject<InfoBarController> controller_; |
34 | 33 |
35 DISALLOW_COPY_AND_ASSIGN(InfoBarCocoa); | 34 DISALLOW_COPY_AND_ASSIGN(InfoBarCocoa); |
36 }; | 35 }; |
37 | 36 |
38 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ | 37 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ |
OLD | NEW |