OLD | NEW |
| (Empty) |
1 // Copyright 2015 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/views/mus/platform_window_mus.h" | |
6 | |
7 #include "build/build_config.h" | |
8 #include "components/bitmap_uploader/bitmap_uploader.h" | |
9 #include "components/mus/public/cpp/property_type_converters.h" | |
10 #include "components/mus/public/cpp/window_property.h" | |
11 #include "components/mus/public/interfaces/window_manager.mojom.h" | |
12 #include "ui/base/view_prop.h" | |
13 #include "ui/events/mojo/input_events_type_converters.h" | |
14 #include "ui/platform_window/platform_window_delegate.h" | |
15 #include "ui/views/mus/window_manager_connection.h" | |
16 | |
17 using mus::mojom::EventResult; | |
18 | |
19 namespace views { | |
20 | |
21 namespace { | |
22 | |
23 static uint32_t accelerated_widget_count = 1; | |
24 | |
25 } // namespace | |
26 | |
27 PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate, | |
28 shell::Connector* connector, | |
29 mus::Window* mus_window) | |
30 : delegate_(delegate), | |
31 mus_window_(mus_window), | |
32 mus_window_destroyed_(false) { | |
33 DCHECK(delegate_); | |
34 DCHECK(mus_window_); | |
35 | |
36 // We need accelerated widget numbers to be different for each | |
37 // window and fit in the smallest sizeof(AcceleratedWidget) uint32_t | |
38 // has this property. | |
39 #if defined(OS_WIN) || defined(OS_ANDROID) | |
40 gfx::AcceleratedWidget accelerated_widget = | |
41 reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++); | |
42 #else | |
43 gfx::AcceleratedWidget accelerated_widget = | |
44 static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++); | |
45 #endif | |
46 delegate_->OnAcceleratedWidgetAvailable(accelerated_widget, 1.f); | |
47 | |
48 if (connector) { | |
49 bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(mus_window_)); | |
50 bitmap_uploader_->Init(connector); | |
51 prop_.reset( | |
52 new ui::ViewProp(accelerated_widget, | |
53 bitmap_uploader::kBitmapUploaderForAcceleratedWidget, | |
54 bitmap_uploader_.get())); | |
55 } | |
56 } | |
57 | |
58 PlatformWindowMus::~PlatformWindowMus() {} | |
59 | |
60 void PlatformWindowMus::Show() {} | |
61 | |
62 void PlatformWindowMus::Hide() {} | |
63 | |
64 void PlatformWindowMus::Close() { | |
65 NOTIMPLEMENTED(); | |
66 } | |
67 | |
68 void PlatformWindowMus::SetBounds(const gfx::Rect& bounds) {} | |
69 | |
70 gfx::Rect PlatformWindowMus::GetBounds() { | |
71 return mus_window_->bounds(); | |
72 } | |
73 | |
74 void PlatformWindowMus::SetTitle(const base::string16& title) { | |
75 NOTIMPLEMENTED(); | |
76 } | |
77 | |
78 void PlatformWindowMus::SetCapture() {} | |
79 | |
80 void PlatformWindowMus::ReleaseCapture() {} | |
81 | |
82 void PlatformWindowMus::ToggleFullscreen() { | |
83 NOTIMPLEMENTED(); | |
84 } | |
85 | |
86 void PlatformWindowMus::Maximize() {} | |
87 | |
88 void PlatformWindowMus::Minimize() {} | |
89 | |
90 void PlatformWindowMus::Restore() {} | |
91 | |
92 void PlatformWindowMus::SetCursor(ui::PlatformCursor cursor) { | |
93 NOTIMPLEMENTED(); | |
94 } | |
95 | |
96 void PlatformWindowMus::MoveCursorTo(const gfx::Point& location) { | |
97 NOTIMPLEMENTED(); | |
98 } | |
99 | |
100 void PlatformWindowMus::ConfineCursorToBounds(const gfx::Rect& bounds) { | |
101 NOTIMPLEMENTED(); | |
102 } | |
103 | |
104 ui::PlatformImeController* PlatformWindowMus::GetPlatformImeController() { | |
105 return nullptr; | |
106 } | |
107 | |
108 } // namespace views | |
OLD | NEW |