Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / infobars / infobar_cocoa.h
blobb48c6a4213bba28cf3b3595ed39e7b2801e2b0cf
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_INFOBARS_INFOBAR_COCOA_H_
6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_
8 #include "base/mac/scoped_nsobject.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/infobars/infobar.h"
12 @class InfoBarController;
14 // The cocoa specific implementation of InfoBar. The real info bar logic is
15 // actually in InfoBarController.
16 class InfoBarCocoa : public InfoBar {
17 public:
18 explicit InfoBarCocoa(scoped_ptr<InfoBarDelegate> delegate);
20 virtual ~InfoBarCocoa();
22 InfoBarController* controller() const { return controller_; }
24 void set_controller(InfoBarController* controller) {
25 controller_.reset([controller retain]);
28 // These functions allow access to protected InfoBar functions.
29 InfoBarService* OwnerCocoa();
31 base::WeakPtr<InfoBarCocoa> GetWeakPtr();
33 private:
34 // The Objective-C class that contains most of the info bar logic.
35 base::scoped_nsobject<InfoBarController> controller_;
37 // Used to vend the link back to this for |controller_|.
38 base::WeakPtrFactory<InfoBarCocoa> weak_ptr_factory_;
40 DISALLOW_COPY_AND_ASSIGN(InfoBarCocoa);
43 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_