blob: 754e15fc24e61e6898d719356bd9c1352d07b9fa [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
[email protected]6c2381d2011-10-19 02:52:538#include "content/public/browser/notification_source.h"
[email protected]08397d52011-02-05 01:53:389#include "ui/gfx/native_widget_types.h"
[email protected]96342782009-05-23 15:24:2010
[email protected]6c2381d2011-10-19 02:52:5311namespace content {
12
[email protected]fecec5632009-06-03 22:14:1113// Specialization of the Source class for native windows. On Windows, these are
14// HWNDs rather than pointers, and since the Source class expects a pointer
15// type, this is necessary. On Mac/Linux, these are pointers, so this is
16// unnecessary but harmless.
[email protected]96342782009-05-23 15:24:2017template<>
[email protected]6c2381d2011-10-19 02:52:5318class Source<gfx::NativeWindow> : public content::NotificationSource {
[email protected]96342782009-05-23 15:24:2019 public:
[email protected]6c2381d2011-10-19 02:52:5320 explicit Source(gfx::NativeWindow wnd) : content::NotificationSource(wnd) {}
[email protected]96342782009-05-23 15:24:2021
[email protected]6c2381d2011-10-19 02:52:5322 explicit Source(const content::NotificationSource& other)
23 : content::NotificationSource(other) {}
[email protected]96342782009-05-23 15:24:2024
[email protected]5c06c5962009-05-26 21:29:0825 gfx::NativeWindow operator->() const { return ptr(); }
[email protected]fecec5632009-06-03 22:14:1126 gfx::NativeWindow ptr() const {
27 return static_cast<gfx::NativeWindow>(const_cast<void*>(ptr_));
28 }
[email protected]96342782009-05-23 15:24:2029};
30
[email protected]6c2381d2011-10-19 02:52:5331}
32
[email protected]7596aa42011-10-26 00:57:2233#endif // CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_