Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: ui/ozone/platform/dri/dri_window.cc

Issue 402213002: [Ozone] Migrate platform DRI & GBM to platform_window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_window.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_window.cc
diff --git a/ui/ozone/platform/dri/dri_window.cc b/ui/ozone/platform/dri/dri_window.cc
new file mode 100644
index 0000000000000000000000000000000000000000..180a8baff4aaed3c3f99f4727f97aa15bd98b9cc
--- /dev/null
+++ b/ui/ozone/platform/dri/dri_window.cc
@@ -0,0 +1,69 @@
+// 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/dri_window.h"
+
+#include "ui/events/event.h"
+#include "ui/events/platform/platform_event_source.h"
+#include "ui/ozone/public/cursor_factory_ozone.h"
+#include "ui/ozone/public/surface_factory_ozone.h"
+#include "ui/platform_window/platform_window_delegate.h"
+
+namespace ui {
+
+DriWindow::DriWindow(PlatformWindowDelegate* delegate,
+ const gfx::Rect& bounds)
+ : delegate_(delegate), bounds_(bounds) {
+ widget_ = SurfaceFactoryOzone::GetInstance()->GetAcceleratedWidget();
+ delegate_->OnAcceleratedWidgetAvailable(widget_);
+ PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
+}
+
+DriWindow::~DriWindow() {
+ PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
+}
+
+void DriWindow::Show() {}
+
+void DriWindow::Hide() {}
+
+void DriWindow::Close() {}
+
+void DriWindow::SetBounds(const gfx::Rect& bounds) {
+ bounds_ = bounds;
+ delegate_->OnBoundsChanged(bounds);
+}
+
+gfx::Rect DriWindow::GetBounds() {
+ return bounds_;
+}
+
+void DriWindow::SetCapture() {}
+
+void DriWindow::ReleaseCapture() {}
+
+void DriWindow::ToggleFullscreen() {}
+
+void DriWindow::Maximize() {}
+
+void DriWindow::Minimize() {}
+
+void DriWindow::Restore() {}
+
+bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) {
+ CHECK(ne);
+ Event* event = static_cast<Event*>(ne);
+ if (event->IsMouseEvent() || event->IsScrollEvent())
+ return ui::CursorFactoryOzone::GetInstance()->GetCursorWindow() == widget_;
+
+ return true;
+}
+
+uint32_t DriWindow::DispatchEvent(const PlatformEvent& ne) {
+ Event* event = static_cast<Event*>(ne);
+ delegate_->DispatchEvent(event);
+ return POST_DISPATCH_STOP_PROPAGATION;
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/dri_window.h ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698