infobar_cocoa.h revision 424c4d7b64af9d0d8fd9624f381f469654d5e3d2
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_INFOBARS_INFOBAR_COCOA_H_ 6#define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ 7 8#include "base/mac/scoped_nsobject.h" 9#include "chrome/browser/infobars/infobar.h" 10 11@class InfoBarController; 12 13// The cocoa specific implementation of InfoBar. The real info bar logic is 14// actually in InfoBarController. 15class InfoBarCocoa : public InfoBar { 16 public: 17 InfoBarCocoa(InfoBarService* owner, InfoBarDelegate* delegate); 18 19 virtual ~InfoBarCocoa(); 20 21 InfoBarController* controller() const { return controller_; } 22 23 void set_controller(InfoBarController* controller) { 24 controller_.reset([controller retain]); 25 } 26 27 // These functions allow access to protected InfoBar functions. 28 void RemoveSelfCocoa(); 29 InfoBarService* OwnerCocoa(); 30 31 private: 32 // The Objective-C class that contains most of the info bar logic. 33 base::scoped_nsobject<InfoBarController> controller_; 34 35 DISALLOW_COPY_AND_ASSIGN(InfoBarCocoa); 36}; 37 38#endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_COCOA_H_ 39