| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/logging.h" // for DCHECK | 9 #include "base/logging.h" // for DCHECK |
| 10 | 10 |
| 11 @class InfoBarController; | 11 @class InfoBarController; |
| 12 | 12 |
| 13 // A C++ wrapper around an Objective-C InfoBarController. This class | 13 // A C++ wrapper around an Objective-C InfoBarController. This class |
| 14 // exists solely to be the return value for InfoBarDelegate::CreateInfoBar(), | 14 // exists solely to be the return value for InfoBarDelegate::CreateInfoBar(), |
| 15 // as defined in chrome/browser/tab_contents/infobar_delegate.h. This | 15 // as defined in chrome/browser/tab_contents/confirm_infobar_delegate.h. This |
| 16 // class would be analogous to the various bridge classes we already | 16 // class would be analogous to the various bridge classes we already |
| 17 // have, but since there is no pre-defined InfoBar interface, it is | 17 // have, but since there is no pre-defined InfoBar interface, it is |
| 18 // easier to simply throw away this object and deal with the | 18 // easier to simply throw away this object and deal with the |
| 19 // controller directly rather than pass messages through a bridge. | 19 // controller directly rather than pass messages through a bridge. |
| 20 // | 20 // |
| 21 // Callers should delete the returned InfoBar immediately after | 21 // Callers should delete the returned InfoBar immediately after |
| 22 // calling CreateInfoBar(), as the returned InfoBar* object is not | 22 // calling CreateInfoBar(), as the returned InfoBar* object is not |
| 23 // pointed to by anyone. Expected usage: | 23 // pointed to by anyone. Expected usage: |
| 24 // | 24 // |
| 25 // scoped_ptr<InfoBar> infobar(delegate->CreateInfoBar()); | 25 // scoped_ptr<InfoBar> infobar(delegate->CreateInfoBar()); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // Pointer to the infobar controller. Is never null. | 42 // Pointer to the infobar controller. Is never null. |
| 43 InfoBarController* controller_; // weak | 43 InfoBarController* controller_; // weak |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(InfoBar); | 45 DISALLOW_COPY_AND_ASSIGN(InfoBar); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_H_ | 48 #endif // CHROME_BROWSER_UI_COCOA_INFOBARS_INFOBAR_H_ |
| OLD | NEW |