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

Side by Side Diff: ui/ozone/platform/dri/dri_window.cc

Issue 556073003: [Ozone-DRI] Do proper bounds checks when moving the cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@restore-cursor
Patch Set: . Created 6 years, 3 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
« no previous file with comments | « ui/ozone/platform/dri/dri_window.h ('k') | ui/ozone/platform/dri/dri_window_delegate_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/dri/dri_window.h" 5 #include "ui/ozone/platform/dri/dri_window.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/ozone/evdev/event_factory_evdev.h" 8 #include "ui/events/ozone/evdev/event_factory_evdev.h"
9 #include "ui/events/platform/platform_event_source.h" 9 #include "ui/events/platform/platform_event_source.h"
10 #include "ui/ozone/platform/dri/dri_cursor.h" 10 #include "ui/ozone/platform/dri/dri_cursor.h"
11 #include "ui/ozone/platform/dri/dri_window_delegate.h" 11 #include "ui/ozone/platform/dri/dri_window_delegate.h"
12 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
12 #include "ui/ozone/platform/dri/dri_window_manager.h" 13 #include "ui/ozone/platform/dri/dri_window_manager.h"
13 #include "ui/ozone/public/cursor_factory_ozone.h" 14 #include "ui/ozone/public/cursor_factory_ozone.h"
14 #include "ui/platform_window/platform_window_delegate.h" 15 #include "ui/platform_window/platform_window_delegate.h"
15 16
16 namespace ui { 17 namespace ui {
17 18
18 DriWindow::DriWindow(PlatformWindowDelegate* delegate, 19 DriWindow::DriWindow(PlatformWindowDelegate* delegate,
19 const gfx::Rect& bounds, 20 const gfx::Rect& bounds,
20 scoped_ptr<DriWindowDelegate> dri_window_delegate, 21 scoped_ptr<DriWindowDelegate> dri_window_delegate,
21 EventFactoryEvdev* event_factory, 22 EventFactoryEvdev* event_factory,
23 DriWindowDelegateManager* window_delegate_manager,
22 DriWindowManager* window_manager, 24 DriWindowManager* window_manager,
23 DriCursor* cursor) 25 DriCursor* cursor)
24 : delegate_(delegate), 26 : delegate_(delegate),
25 bounds_(bounds), 27 bounds_(bounds),
26 widget_(dri_window_delegate->GetAcceleratedWidget()), 28 widget_(dri_window_delegate->GetAcceleratedWidget()),
27 dri_window_delegate_(dri_window_delegate.get()), 29 dri_window_delegate_(dri_window_delegate.get()),
28 event_factory_(event_factory), 30 event_factory_(event_factory),
31 window_delegate_manager_(window_delegate_manager),
29 window_manager_(window_manager), 32 window_manager_(window_manager),
30 cursor_(cursor) { 33 cursor_(cursor) {
31 window_manager_->AddWindowDelegate(widget_, dri_window_delegate.Pass()); 34 window_delegate_manager_->AddWindowDelegate(widget_,
35 dri_window_delegate.Pass());
36 window_manager_->AddWindow(widget_, this);
32 } 37 }
33 38
34 DriWindow::~DriWindow() { 39 DriWindow::~DriWindow() {
35 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); 40 PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
36 dri_window_delegate_->Shutdown(); 41 dri_window_delegate_->Shutdown();
37 window_manager_->RemoveWindowDelegate(widget_); 42 window_manager_->RemoveWindow(widget_);
43 window_delegate_manager_->RemoveWindowDelegate(widget_);
38 } 44 }
39 45
40 void DriWindow::Initialize() { 46 void DriWindow::Initialize() {
41 dri_window_delegate_->Initialize(); 47 dri_window_delegate_->Initialize();
42 dri_window_delegate_->OnBoundsChanged(bounds_); 48 dri_window_delegate_->OnBoundsChanged(bounds_);
43 delegate_->OnAcceleratedWidgetAvailable(widget_); 49 delegate_->OnAcceleratedWidgetAvailable(widget_);
44 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); 50 PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
45 } 51 }
46 52
47 void DriWindow::Show() {} 53 void DriWindow::Show() {}
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return true; 101 return true;
96 } 102 }
97 103
98 uint32_t DriWindow::DispatchEvent(const PlatformEvent& ne) { 104 uint32_t DriWindow::DispatchEvent(const PlatformEvent& ne) {
99 Event* event = static_cast<Event*>(ne); 105 Event* event = static_cast<Event*>(ne);
100 delegate_->DispatchEvent(event); 106 delegate_->DispatchEvent(event);
101 return POST_DISPATCH_STOP_PROPAGATION; 107 return POST_DISPATCH_STOP_PROPAGATION;
102 } 108 }
103 109
104 } // namespace ui 110 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_window.h ('k') | ui/ozone/platform/dri/dri_window_delegate_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698