[email protected] | 7f070d4 | 2011-03-09 20:25:32 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 7596aa4 | 2011-10-26 00:57:22 | [diff] [blame] | 5 | #ifndef CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_ |
6 | #define CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_ | ||||
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 7 | |
Christopher Cameron | 359c61e2 | 2018-10-18 08:06:20 | [diff] [blame] | 8 | #include "build/build_config.h" |
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 9 | #include "content/public/browser/notification_source.h" |
[email protected] | 08397d5 | 2011-02-05 01:53:38 | [diff] [blame] | 10 | #include "ui/gfx/native_widget_types.h" |
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 11 | |
Christopher Cameron | 359c61e2 | 2018-10-18 08:06:20 | [diff] [blame] | 12 | #if !defined(OS_MACOSX) |
13 | |||||
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 14 | namespace content { |
15 | |||||
[email protected] | fecec563 | 2009-06-03 22:14:11 | [diff] [blame] | 16 | // Specialization of the Source class for native windows. On Windows, these are |
17 | // HWNDs rather than pointers, and since the Source class expects a pointer | ||||
18 | // type, this is necessary. On Mac/Linux, these are pointers, so this is | ||||
19 | // unnecessary but harmless. | ||||
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 20 | template<> |
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 21 | class Source<gfx::NativeWindow> : public content::NotificationSource { |
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 22 | public: |
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 23 | explicit Source(gfx::NativeWindow wnd) : content::NotificationSource(wnd) {} |
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 24 | |
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 25 | explicit Source(const content::NotificationSource& other) |
26 | : content::NotificationSource(other) {} | ||||
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 27 | |
[email protected] | 5c06c596 | 2009-05-26 21:29:08 | [diff] [blame] | 28 | gfx::NativeWindow operator->() const { return ptr(); } |
[email protected] | fecec563 | 2009-06-03 22:14:11 | [diff] [blame] | 29 | gfx::NativeWindow ptr() const { |
30 | return static_cast<gfx::NativeWindow>(const_cast<void*>(ptr_)); | ||||
31 | } | ||||
[email protected] | 9634278 | 2009-05-23 15:24:20 | [diff] [blame] | 32 | }; |
33 | |||||
Christopher Cameron | 359c61e2 | 2018-10-18 08:06:20 | [diff] [blame] | 34 | } // namespace content |
35 | |||||
36 | #endif | ||||
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 37 | |
[email protected] | 7596aa4 | 2011-10-26 00:57:22 | [diff] [blame] | 38 | #endif // CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_ |