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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #include "ui/ozone/platform/dri/dri_window.h"
6
7 #include "ui/events/event.h"
8 #include "ui/events/platform/platform_event_source.h"
9 #include "ui/ozone/public/cursor_factory_ozone.h"
10 #include "ui/ozone/public/surface_factory_ozone.h"
11 #include "ui/platform_window/platform_window_delegate.h"
12
13 namespace ui {
14
15 DriWindow::DriWindow(PlatformWindowDelegate* delegate,
16 const gfx::Rect& bounds)
17 : delegate_(delegate), bounds_(bounds) {
18 widget_ = SurfaceFactoryOzone::GetInstance()->GetAcceleratedWidget();
19 delegate_->OnAcceleratedWidgetAvailable(widget_);
20 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
21 }
22
23 DriWindow::~DriWindow() {
24 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
25 }
26
27 void DriWindow::Show() {}
28
29 void DriWindow::Hide() {}
30
31 void DriWindow::Close() {}
32
33 void DriWindow::SetBounds(const gfx::Rect& bounds) {
34 bounds_ = bounds;
35 delegate_->OnBoundsChanged(bounds);
36 }
37
38 gfx::Rect DriWindow::GetBounds() {
39 return bounds_;
40 }
41
42 void DriWindow::SetCapture() {}
43
44 void DriWindow::ReleaseCapture() {}
45
46 void DriWindow::ToggleFullscreen() {}
47
48 void DriWindow::Maximize() {}
49
50 void DriWindow::Minimize() {}
51
52 void DriWindow::Restore() {}
53
54 bool DriWindow::CanDispatchEvent(const PlatformEvent& ne) {
55 CHECK(ne);
56 Event* event = static_cast<Event*>(ne);
57 if (event->IsMouseEvent() || event->IsScrollEvent())
58 return ui::CursorFactoryOzone::GetInstance()->GetCursorWindow() == widget_;
59
60 return true;
61 }
62
63 uint32_t DriWindow::DispatchEvent(const PlatformEvent& ne) {
64 Event* event = static_cast<Event*>(ne);
65 delegate_->DispatchEvent(event);
66 return POST_DISPATCH_STOP_PROPAGATION;
67 }
68
69 } // namespace ui
OLDNEW
« 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