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

Side by Side Diff: mojo/services/native_viewport/native_viewport_x11.cc

Issue 120503003: run aura_demo as a mojo app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « mojo/services/native_viewport/native_viewport_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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"
11 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
12 #include "ui/gfx/x/x11_types.h" 12 #include "ui/gfx/x/x11_types.h"
13 13
14 namespace mojo { 14 namespace mojo {
15 namespace services { 15 namespace services {
16 16
17 class NativeViewportX11 : public NativeViewport, 17 class NativeViewportX11 : public NativeViewport,
18 public base::MessagePumpDispatcher { 18 public base::MessagePumpDispatcher {
19 public: 19 public:
20 NativeViewportX11(NativeViewportDelegate* delegate) 20 NativeViewportX11(NativeViewportDelegate* delegate)
21 : delegate_(delegate), 21 : delegate_(delegate),
22 bounds_(10, 10, 500, 500) { 22 bounds_(10, 10, 800, 600) {
23 } 23 }
24 24
25 virtual ~NativeViewportX11() { 25 virtual ~NativeViewportX11() {
26 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(this); 26 base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(this);
27 base::MessagePumpX11::Current()->RemoveDispatcherForWindow(window_); 27 base::MessagePumpX11::Current()->RemoveDispatcherForWindow(window_);
28 28
29 XDestroyWindow(gfx::GetXDisplay(), window_); 29 XDestroyWindow(gfx::GetXDisplay(), window_);
30 } 30 }
31 31
32 private: 32 private:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 // static 88 // static
89 scoped_ptr<NativeViewport> NativeViewport::Create( 89 scoped_ptr<NativeViewport> NativeViewport::Create(
90 shell::Context* context, 90 shell::Context* context,
91 NativeViewportDelegate* delegate) { 91 NativeViewportDelegate* delegate) {
92 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass(); 92 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass();
93 } 93 }
94 94
95 } // namespace services 95 } // namespace services
96 } // namespace mojo 96 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/native_viewport_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698