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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 &swa); | 50 &swa); |
51 | 51 |
52 atom_wm_protocols_ = XInternAtom(display, "WM_PROTOCOLS", 1); | 52 atom_wm_protocols_ = XInternAtom(display, "WM_PROTOCOLS", 1); |
53 atom_wm_delete_window_ = XInternAtom(display, "WM_DELETE_WINDOW", 1); | 53 atom_wm_delete_window_ = XInternAtom(display, "WM_DELETE_WINDOW", 1); |
54 XSetWMProtocols(display, window_, &atom_wm_delete_window_, 1); | 54 XSetWMProtocols(display, window_, &atom_wm_delete_window_, 1); |
55 | 55 |
56 base::MessagePumpX11::Current()->AddDispatcherForWindow(this, window_); | 56 base::MessagePumpX11::Current()->AddDispatcherForWindow(this, window_); |
57 base::MessagePumpX11::Current()->AddDispatcherForRootWindow(this); | 57 base::MessagePumpX11::Current()->AddDispatcherForRootWindow(this); |
58 | 58 |
59 delegate_->OnAcceleratedWidgetAvailable(window_); | 59 delegate_->OnAcceleratedWidgetAvailable(window_); |
60 delegate_->OnBoundsChanged(bounds_); | |
61 } | 60 } |
62 | 61 |
63 virtual void Show() OVERRIDE { | 62 virtual void Show() OVERRIDE { |
64 XDisplay* display = gfx::GetXDisplay(); | 63 XDisplay* display = gfx::GetXDisplay(); |
65 XMapWindow(display, window_); | 64 XMapWindow(display, window_); |
66 XFlush(display); | 65 XFlush(display); |
67 } | 66 } |
68 | 67 |
69 virtual void Hide() OVERRIDE { | 68 virtual void Hide() OVERRIDE { |
70 XWithdrawWindow(gfx::GetXDisplay(), window_, 0); | 69 XWithdrawWindow(gfx::GetXDisplay(), window_, 0); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 116 |
118 // static | 117 // static |
119 scoped_ptr<NativeViewport> NativeViewport::Create( | 118 scoped_ptr<NativeViewport> NativeViewport::Create( |
120 shell::Context* context, | 119 shell::Context* context, |
121 NativeViewportDelegate* delegate) { | 120 NativeViewportDelegate* delegate) { |
122 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass(); | 121 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass(); |
123 } | 122 } |
124 | 123 |
125 } // namespace services | 124 } // namespace services |
126 } // namespace mojo | 125 } // namespace mojo |
OLD | NEW |