OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FRAME_INFOBARS_INTERNAL_SUBCLASSING_WINDOW_WITH_DELEGATE_H_ | 5 #ifndef CHROME_FRAME_INFOBARS_INTERNAL_SUBCLASSING_WINDOW_WITH_DELEGATE_H_ |
6 #define CHROME_FRAME_INFOBARS_INTERNAL_SUBCLASSING_WINDOW_WITH_DELEGATE_H_ | 6 #define CHROME_FRAME_INFOBARS_INTERNAL_SUBCLASSING_WINDOW_WITH_DELEGATE_H_ |
7 | 7 |
8 #include <atlbase.h> | 8 #include <atlbase.h> |
9 #include <atlcrack.h> | 9 #include <atlcrack.h> |
10 #include <atlwin.h> | 10 #include <atlwin.h> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/scoped_ptr.h" | 14 #include "base/scoped_ptr.h" |
| 15 #include "base/win/atlcheck.h" |
15 #include "chrome_frame/utils.h" | 16 #include "chrome_frame/utils.h" |
16 | 17 |
17 // Implements behavior common to HostWindowManager and DisplacedWindowManager. | 18 // Implements behavior common to HostWindowManager and DisplacedWindowManager. |
18 template<typename T> class SubclassingWindowWithDelegate | 19 template<typename T> class SubclassingWindowWithDelegate |
19 : public CWindowImpl<T> { | 20 : public CWindowImpl<T> { |
20 public: | 21 public: |
21 // Allows clients to modify the dimensions of the displaced window. | 22 // Allows clients to modify the dimensions of the displaced window. |
22 // Through its destructor, allows clients to know when the subclassed window | 23 // Through its destructor, allows clients to know when the subclassed window |
23 // is destroyed. | 24 // is destroyed. |
24 class Delegate { | 25 class Delegate { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 LPARAM lparam, | 99 LPARAM lparam, |
99 BOOL& handled) { | 100 BOOL& handled) { |
100 return reinterpret_cast<LRESULT>(delegate_.get()); | 101 return reinterpret_cast<LRESULT>(delegate_.get()); |
101 } | 102 } |
102 | 103 |
103 scoped_ptr<Delegate> delegate_; | 104 scoped_ptr<Delegate> delegate_; |
104 DISALLOW_COPY_AND_ASSIGN(SubclassingWindowWithDelegate); | 105 DISALLOW_COPY_AND_ASSIGN(SubclassingWindowWithDelegate); |
105 }; // class SubclassingWindowWithDelegate | 106 }; // class SubclassingWindowWithDelegate |
106 | 107 |
107 #endif // CHROME_FRAME_INFOBARS_INTERNAL_SUBCLASSING_WINDOW_WITH_DELEGATE_H_ | 108 #endif // CHROME_FRAME_INFOBARS_INTERNAL_SUBCLASSING_WINDOW_WITH_DELEGATE_H_ |
OLD | NEW |