Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / browser / native_window_notification_source.h
blob754e15fc24e61e6898d719356bd9c1352d07b9fa
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_
6 #define CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_
8 #include "content/public/browser/notification_source.h"
9 #include "ui/gfx/native_widget_types.h"
11 namespace content {
13 // 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.
17 template<>
18 class Source<gfx::NativeWindow> : public content::NotificationSource {
19 public:
20 explicit Source(gfx::NativeWindow wnd) : content::NotificationSource(wnd) {}
22 explicit Source(const content::NotificationSource& other)
23 : content::NotificationSource(other) {}
25 gfx::NativeWindow operator->() const { return ptr(); }
26 gfx::NativeWindow ptr() const {
27 return static_cast<gfx::NativeWindow>(const_cast<void*>(ptr_));
33 #endif // CHROME_BROWSER_NATIVE_WINDOW_NOTIFICATION_SOURCE_H_