| OLD | NEW |
| 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 "mojo/services/native_viewport/native_viewport.h" | 5 #include "mojo/services/native_viewport/native_viewport.h" |
| 6 | 6 |
| 7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/message_loop/message_pump_x11.h" | 10 #include "base/message_loop/message_pump_x11.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 0, // border width | 43 0, // border width |
| 44 CopyFromParent, // depth | 44 CopyFromParent, // depth |
| 45 InputOutput, | 45 InputOutput, |
| 46 CopyFromParent, // visual | 46 CopyFromParent, // visual |
| 47 CWBackPixmap | CWOverrideRedirect, &swa); | 47 CWBackPixmap | CWOverrideRedirect, &swa); |
| 48 | 48 |
| 49 base::MessagePumpX11::Current()->AddDispatcherForWindow(this, window_); | 49 base::MessagePumpX11::Current()->AddDispatcherForWindow(this, window_); |
| 50 base::MessagePumpX11::Current()->AddDispatcherForRootWindow(this); | 50 base::MessagePumpX11::Current()->AddDispatcherForRootWindow(this); |
| 51 | 51 |
| 52 delegate_->OnAcceleratedWidgetAvailable(window_); | 52 delegate_->OnAcceleratedWidgetAvailable(window_); |
| 53 delegate_->OnBoundsChanged(bounds_); |
| 53 } | 54 } |
| 54 | 55 |
| 55 virtual void Show() OVERRIDE { | 56 virtual void Show() OVERRIDE { |
| 56 XDisplay* display = gfx::GetXDisplay(); | 57 XDisplay* display = gfx::GetXDisplay(); |
| 57 XMapWindow(display, window_); | 58 XMapWindow(display, window_); |
| 58 XFlush(display); | 59 XFlush(display); |
| 59 } | 60 } |
| 60 | 61 |
| 61 virtual void Close() OVERRIDE { | 62 virtual void Close() OVERRIDE { |
| 62 // TODO(beng): perform this in response to XWindow destruction. | 63 // TODO(beng): perform this in response to XWindow destruction. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 93 | 94 |
| 94 // static | 95 // static |
| 95 scoped_ptr<NativeViewport> NativeViewport::Create( | 96 scoped_ptr<NativeViewport> NativeViewport::Create( |
| 96 shell::Context* context, | 97 shell::Context* context, |
| 97 NativeViewportDelegate* delegate) { | 98 NativeViewportDelegate* delegate) { |
| 98 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass(); | 99 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass(); |
| 99 } | 100 } |
| 100 | 101 |
| 101 } // namespace services | 102 } // namespace services |
| 102 } // namespace mojo | 103 } // namespace mojo |
| OLD | NEW |