| Index: ui/ozone/platform/dri/native_window_delegate_proxy.cc
|
| diff --git a/ui/ozone/platform/dri/native_window_delegate_proxy.cc b/ui/ozone/platform/dri/native_window_delegate_proxy.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..13b13dbca8f549b4a0b1fa0c985c68f86df34abd
|
| --- /dev/null
|
| +++ b/ui/ozone/platform/dri/native_window_delegate_proxy.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ui/ozone/platform/dri/native_window_delegate_proxy.h"
|
| +
|
| +#include "ui/ozone/platform/dri/gpu/gpu_messages.h"
|
| +#include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
|
| +#include "ui/ozone/platform/dri/native_window_manager.h"
|
| +
|
| +namespace ui {
|
| +
|
| +NativeWindowDelegateProxy::NativeWindowDelegateProxy(
|
| + NativeWindowManager* window_manager,
|
| + GpuPlatformSupportHostGbm* sender)
|
| + : widget_(window_manager->AllocateAcceleratedWidget()),
|
| + window_manager_(window_manager),
|
| + sender_(sender) {
|
| + window_manager_->AddNativeWindowDelegate(widget_, this);
|
| + bool status =
|
| + sender_->Send(new DriGpuMsg_CreateNativeWindowDelegate(widget_));
|
| + DCHECK(status);
|
| +}
|
| +
|
| +NativeWindowDelegateProxy::~NativeWindowDelegateProxy() {
|
| + window_manager_->RemoveNativeWindowDelegate(widget_);
|
| + bool status =
|
| + sender_->Send(new DriGpuMsg_DestoryNativeWindowDelegate(widget_));
|
| + DCHECK(status);
|
| +}
|
| +
|
| +gfx::AcceleratedWidget NativeWindowDelegateProxy::GetWidget() {
|
| + return widget_;
|
| +}
|
| +
|
| +HardwareDisplayController* NativeWindowDelegateProxy::GetController() {
|
| + NOTREACHED();
|
| + return NULL;
|
| +}
|
| +
|
| +void NativeWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) {
|
| + bool status = sender_->Send(
|
| + new DriGpuMsg_NativeWindowBoundsChanged(widget_, bounds));
|
| + DCHECK(status);
|
| +}
|
| +
|
| +} // namespace ui
|
|
|