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

Side by Side Diff: mojo/services/native_viewport/native_viewport_service.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 | « no previous file | mojo/services/native_viewport/native_viewport_x11.cc » ('j') | 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_service.h" 5 #include "mojo/services/native_viewport/native_viewport_service.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "mojo/public/bindings/allocation_scope.h" 9 #include "mojo/public/bindings/allocation_scope.h"
10 #include "mojo/services/gles2/command_buffer_impl.h" 10 #include "mojo/services/gles2/command_buffer_impl.h"
(...skipping 23 matching lines...) Expand all
34 : widget_(gfx::kNullAcceleratedWidget), 34 : widget_(gfx::kNullAcceleratedWidget),
35 waiting_for_event_ack_(false), 35 waiting_for_event_ack_(false),
36 pending_event_timestamp_(0) {} 36 pending_event_timestamp_(0) {}
37 virtual ~NativeViewportImpl() {} 37 virtual ~NativeViewportImpl() {}
38 38
39 virtual void Create(const Rect& bounds) MOJO_OVERRIDE { 39 virtual void Create(const Rect& bounds) MOJO_OVERRIDE {
40 native_viewport_ = 40 native_viewport_ =
41 services::NativeViewport::Create(context(), this); 41 services::NativeViewport::Create(context(), this);
42 native_viewport_->Init(bounds); 42 native_viewport_->Init(bounds);
43 client()->OnCreated(); 43 client()->OnCreated();
44 OnBoundsChanged(bounds);
44 } 45 }
45 46
46 virtual void Show() MOJO_OVERRIDE { 47 virtual void Show() MOJO_OVERRIDE {
47 native_viewport_->Show(); 48 native_viewport_->Show();
48 } 49 }
49 50
50 virtual void Hide() MOJO_OVERRIDE { 51 virtual void Hide() MOJO_OVERRIDE {
51 native_viewport_->Hide(); 52 native_viewport_->Hide();
52 } 53 }
53 54
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 base::MessageLoopForUI loop; 203 base::MessageLoopForUI loop;
203 mojo::Application app(shell_handle); 204 mojo::Application app(shell_handle);
204 app.AddServiceFactory( 205 app.AddServiceFactory(
205 new mojo::ServiceFactory<mojo::services::NativeViewportImpl, 206 new mojo::ServiceFactory<mojo::services::NativeViewportImpl,
206 mojo::shell::Context>); 207 mojo::shell::Context>);
207 loop.Run(); 208 loop.Run();
208 return MOJO_RESULT_OK; 209 return MOJO_RESULT_OK;
209 } 210 }
210 211
211 #endif // !OS_ANDROID 212 #endif // !OS_ANDROID
OLDNEW
« no previous file with comments | « no previous file | mojo/services/native_viewport/native_viewport_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698