OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_WINDOW_WINDOW_DELEGATE_H_ | 5 #ifndef CHROME_VIEWS_WINDOW_WINDOW_DELEGATE_H_ |
6 #define CHROME_VIEWS_WINDOW_WINDOW_DELEGATE_H_ | 6 #define CHROME_VIEWS_WINDOW_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // An accessor to the Window this delegate is bound to. | 141 // An accessor to the Window this delegate is bound to. |
142 Window* window() const { return window_.get(); } | 142 Window* window() const { return window_.get(); } |
143 | 143 |
144 protected: | 144 protected: |
145 // Releases the Window* we maintain. This should be done by a delegate in its | 145 // Releases the Window* we maintain. This should be done by a delegate in its |
146 // WindowClosing handler if it intends to be re-cycled to be used on a | 146 // WindowClosing handler if it intends to be re-cycled to be used on a |
147 // different Window. | 147 // different Window. |
148 void ReleaseWindow(); | 148 void ReleaseWindow(); |
149 | 149 |
150 private: | 150 private: |
| 151 friend class WindowGtk; |
151 friend class WindowWin; | 152 friend class WindowWin; |
152 // This is a little unusual. We use a scoped_ptr here because it's | 153 // This is a little unusual. We use a scoped_ptr here because it's |
153 // initialized to NULL automatically. We do this because we want to allow | 154 // initialized to NULL automatically. We do this because we want to allow |
154 // people using this helper to not have to call a ctor on this object. | 155 // people using this helper to not have to call a ctor on this object. |
155 // Instead we just release the owning ref this pointer has when we are | 156 // Instead we just release the owning ref this pointer has when we are |
156 // destroyed. | 157 // destroyed. |
157 scoped_ptr<Window> window_; | 158 scoped_ptr<Window> window_; |
158 }; | 159 }; |
159 | 160 |
160 } // namespace views | 161 } // namespace views |
161 | 162 |
162 #endif // CHROME_VIEWS_WINDOW_WINDOW_DELEGATE_H_ | 163 #endif // CHROME_VIEWS_WINDOW_WINDOW_DELEGATE_H_ |
OLD | NEW |