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

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

Issue 742103002: Ozone keyboard layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lite-code
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ozone_platform_dri.h" 5 #include "ui/ozone/platform/dri/ozone_platform_dri.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" 8 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
9 #include "ui/events/ozone/device/device_manager.h" 9 #include "ui/events/ozone/device/device_manager.h"
10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" 10 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
11 #include "ui/events/ozone/evdev/event_factory_evdev.h" 11 #include "ui/events/ozone/evdev/event_factory_evdev.h"
12 #include "ui/events/ozone/layout/stub/stub_keyboard_layouts.h"
12 #include "ui/ozone/platform/dri/display_manager.h" 13 #include "ui/ozone/platform/dri/display_manager.h"
13 #include "ui/ozone/platform/dri/dri_buffer.h" 14 #include "ui/ozone/platform/dri/dri_buffer.h"
14 #include "ui/ozone/platform/dri/dri_cursor.h" 15 #include "ui/ozone/platform/dri/dri_cursor.h"
15 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h" 16 #include "ui/ozone/platform/dri/dri_gpu_platform_support.h"
16 #include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h" 17 #include "ui/ozone/platform/dri/dri_gpu_platform_support_host.h"
17 #include "ui/ozone/platform/dri/dri_surface_factory.h" 18 #include "ui/ozone/platform/dri/dri_surface_factory.h"
18 #include "ui/ozone/platform/dri/dri_window.h" 19 #include "ui/ozone/platform/dri/dri_window.h"
19 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h" 20 #include "ui/ozone/platform/dri/dri_window_delegate_impl.h"
20 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h" 21 #include "ui/ozone/platform/dri/dri_window_delegate_manager.h"
21 #include "ui/ozone/platform/dri/dri_window_manager.h" 22 #include "ui/ozone/platform/dri/dri_window_manager.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 55 }
55 CursorFactoryOzone* GetCursorFactoryOzone() override { 56 CursorFactoryOzone* GetCursorFactoryOzone() override {
56 return cursor_factory_ozone_.get(); 57 return cursor_factory_ozone_.get();
57 } 58 }
58 GpuPlatformSupport* GetGpuPlatformSupport() override { 59 GpuPlatformSupport* GetGpuPlatformSupport() override {
59 return gpu_platform_support_.get(); 60 return gpu_platform_support_.get();
60 } 61 }
61 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { 62 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
62 return gpu_platform_support_host_.get(); 63 return gpu_platform_support_host_.get();
63 } 64 }
65 KeyboardLayoutsOzone* GetKeyboardLayouts() override {
66 return keyboard_layouts_ozone_.get();
67 }
64 scoped_ptr<PlatformWindow> CreatePlatformWindow( 68 scoped_ptr<PlatformWindow> CreatePlatformWindow(
65 PlatformWindowDelegate* delegate, 69 PlatformWindowDelegate* delegate,
66 const gfx::Rect& bounds) override { 70 const gfx::Rect& bounds) override {
67 scoped_ptr<DriWindow> platform_window( 71 scoped_ptr<DriWindow> platform_window(
68 new DriWindow(delegate, bounds, gpu_platform_support_host_.get(), 72 new DriWindow(delegate, bounds, gpu_platform_support_host_.get(),
69 event_factory_ozone_.get(), window_manager_.get(), 73 event_factory_ozone_.get(), window_manager_.get(),
70 display_manager_.get())); 74 display_manager_.get()));
71 platform_window->Initialize(); 75 platform_window->Initialize();
72 return platform_window.Pass(); 76 return platform_window.Pass();
73 } 77 }
(...skipping 16 matching lines...) Expand all
90 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); 94 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
91 window_manager_.reset(new DriWindowManager(surface_factory_ozone_.get())); 95 window_manager_.reset(new DriWindowManager(surface_factory_ozone_.get()));
92 event_factory_ozone_.reset(new EventFactoryEvdev(window_manager_->cursor(), 96 event_factory_ozone_.reset(new EventFactoryEvdev(window_manager_->cursor(),
93 device_manager_.get())); 97 device_manager_.get()));
94 if (surface_factory_ozone_->InitializeHardware() != 98 if (surface_factory_ozone_->InitializeHardware() !=
95 DriSurfaceFactory::INITIALIZED) 99 DriSurfaceFactory::INITIALIZED)
96 LOG(FATAL) << "Failed to initialize display hardware."; 100 LOG(FATAL) << "Failed to initialize display hardware.";
97 101
98 if (!ui_thread_gpu_.Initialize()) 102 if (!ui_thread_gpu_.Initialize())
99 LOG(FATAL) << "Failed to initialize dummy channel."; 103 LOG(FATAL) << "Failed to initialize dummy channel.";
104 keyboard_layouts_ozone_.reset(new StubKeyboardLayouts());
100 } 105 }
101 106
102 void InitializeGPU() override {} 107 void InitializeGPU() override {}
103 108
104 private: 109 private:
105 scoped_ptr<DriWrapper> dri_; 110 scoped_ptr<DriWrapper> dri_;
106 scoped_ptr<DriBufferGenerator> buffer_generator_; 111 scoped_ptr<DriBufferGenerator> buffer_generator_;
107 scoped_ptr<ScreenManager> screen_manager_; 112 scoped_ptr<ScreenManager> screen_manager_;
108 scoped_ptr<DeviceManager> device_manager_; 113 scoped_ptr<DeviceManager> device_manager_;
109 114
110 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_; 115 scoped_ptr<DriSurfaceFactory> surface_factory_ozone_;
111 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_; 116 scoped_ptr<BitmapCursorFactoryOzone> cursor_factory_ozone_;
112 scoped_ptr<EventFactoryEvdev> event_factory_ozone_; 117 scoped_ptr<EventFactoryEvdev> event_factory_ozone_;
118 scoped_ptr<KeyboardLayoutsOzone> keyboard_layouts_ozone_;
113 119
114 scoped_ptr<DriWindowManager> window_manager_; 120 scoped_ptr<DriWindowManager> window_manager_;
115 scoped_ptr<DisplayManager> display_manager_; 121 scoped_ptr<DisplayManager> display_manager_;
116 122
117 scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_; 123 scoped_ptr<DriGpuPlatformSupport> gpu_platform_support_;
118 scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_; 124 scoped_ptr<DriGpuPlatformSupportHost> gpu_platform_support_host_;
119 125
120 DriWindowDelegateManager window_delegate_manager_; 126 DriWindowDelegateManager window_delegate_manager_;
121 127
122 UiThreadGpu ui_thread_gpu_; 128 UiThreadGpu ui_thread_gpu_;
123 129
124 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri); 130 DISALLOW_COPY_AND_ASSIGN(OzonePlatformDri);
125 }; 131 };
126 132
127 } // namespace 133 } // namespace
128 134
129 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; } 135 OzonePlatform* CreateOzonePlatformDri() { return new OzonePlatformDri; }
130 136
131 } // namespace ui 137 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698