blob: 9c6c06e04c01523b72f898bc8ddb34c8e24382a9 [file] [log] [blame]
[email protected]7f070d42011-03-09 20:25:321// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]96342782009-05-23 15:24:202// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]7596aa42011-10-26 00:57:225#ifndef CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_
6#define CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_
[email protected]96342782009-05-23 15:24:207
Christopher Cameron359c61e22018-10-18 08:06:208#include "build/build_config.h"
[email protected]6c2381d2011-10-19 02:52:539#include "content/public/browser/notification_source.h"
[email protected]08397d52011-02-05 01:53:3810#include "ui/gfx/native_widget_types.h"
[email protected]96342782009-05-23 15:24:2011
Christopher Cameron359c61e22018-10-18 08:06:2012#if !defined(OS_MACOSX)
13
[email protected]6c2381d2011-10-19 02:52:5314namespace content {
15
[email protected]fecec5632009-06-03 22:14:1116// 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]96342782009-05-23 15:24:2020template<>
[email protected]6c2381d2011-10-19 02:52:5321class Source<gfx::NativeWindow> : public content::NotificationSource {
[email protected]96342782009-05-23 15:24:2022 public:
[email protected]6c2381d2011-10-19 02:52:5323 explicit Source(gfx::NativeWindow wnd) : content::NotificationSource(wnd) {}
[email protected]96342782009-05-23 15:24:2024
[email protected]6c2381d2011-10-19 02:52:5325 explicit Source(const content::NotificationSource& other)
26 : content::NotificationSource(other) {}
[email protected]96342782009-05-23 15:24:2027
[email protected]5c06c5962009-05-26 21:29:0828 gfx::NativeWindow operator->() const { return ptr(); }
[email protected]fecec5632009-06-03 22:14:1129 gfx::NativeWindow ptr() const {
30 return static_cast<gfx::NativeWindow>(const_cast<void*>(ptr_));
31 }
[email protected]96342782009-05-23 15:24:2032};
33
Christopher Cameron359c61e22018-10-18 08:06:2034} // namespace content
35
36#endif
[email protected]6c2381d2011-10-19 02:52:5337
[email protected]7596aa42011-10-26 00:57:2238#endif // CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_