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

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

Issue 165383002: Ensure that OnCreated() gets sent before OnBoundsChanged() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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_service.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"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « mojo/services/native_viewport/native_viewport_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698