Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: chrome/browser/cocoa/infobar.h

Issue 155494: First cut at infobars on Mac. These are not expected to be... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 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_COCOA_INFOBAR_H_
6 #define CHROME_BROWSER_COCOA_INFOBAR_H_
7
8 #include "base/logging.h" // for DCHECK
9
10 @class InfoBarController;
11
12 // A C++ wrapper around an Objective-C InfoBarController. This class
13 // exists solely to be the return value for InfoBarDelegate::CreateInfoBar(),
14 // as defined in chrome/browser/tab_contents/infobar_delegate.h. This
15 // class would be analogous to the various bridge classes we already
16 // have, but since there is no pre-defined InfoBar interface, it is
17 // easier to simply throw away this object and deal with the
18 // controller directly rather than pass messages through a bridge.
19 //
20 // Callers should delete the returned InfoBar immediately after
21 // calling CreateInfoBar(), as the returned InfoBar* object is not
22 // pointed to by anyone. Expected usage:
23 //
24 // scoped_ptr<InfoBar> infobar(delegate->CreateInfoBar());
25 // InfoBarController* controller = infobar->controller();
26 // // Do something with the controller, and save a pointer so it can be
27 // // deleted later. |infobar| will be deleted automatically.
28
29 class InfoBar {
30 public:
31 InfoBar(InfoBarController* controller) {
32 DCHECK(controller);
33 controller_ = controller;
34 }
35
36 InfoBarController* controller() {
37 return controller_;
38 }
39
40 private:
41 // Pointer to the infobar controller. Is never null.
42 InfoBarController* controller_; // weak
43
44 DISALLOW_COPY_AND_ASSIGN(InfoBar);
45 };
46
47 #endif // CHROME_BROWSER_COCOA_INFOBAR_H_
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_window_controller.mm ('k') | chrome/browser/cocoa/infobar_container_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698