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

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

Issue 289873008: Mojo: Make overriding OnConnectionError optional (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
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/macros.h" 7 #include "base/macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "mojo/public/cpp/bindings/allocation_scope.h" 10 #include "mojo/public/cpp/bindings/allocation_scope.h"
(...skipping 23 matching lines...) Expand all
34 NativeViewportImpl(shell::Context* context) 34 NativeViewportImpl(shell::Context* context)
35 : context_(context), 35 : context_(context),
36 widget_(gfx::kNullAcceleratedWidget), 36 widget_(gfx::kNullAcceleratedWidget),
37 waiting_for_event_ack_(false) {} 37 waiting_for_event_ack_(false) {}
38 virtual ~NativeViewportImpl() { 38 virtual ~NativeViewportImpl() {
39 // Destroy the NativeViewport early on as it may call us back during 39 // Destroy the NativeViewport early on as it may call us back during
40 // destruction and we want to be in a known state. 40 // destruction and we want to be in a known state.
41 native_viewport_.reset(); 41 native_viewport_.reset();
42 } 42 }
43 43
44 virtual void OnConnectionError() OVERRIDE {}
45
46 virtual void Create(const Rect& bounds) OVERRIDE { 44 virtual void Create(const Rect& bounds) OVERRIDE {
47 native_viewport_ = 45 native_viewport_ =
48 services::NativeViewport::Create(context_, this); 46 services::NativeViewport::Create(context_, this);
49 native_viewport_->Init(bounds); 47 native_viewport_->Init(bounds);
50 client()->OnCreated(); 48 client()->OnCreated();
51 OnBoundsChanged(bounds); 49 OnBoundsChanged(bounds);
52 } 50 }
53 51
54 virtual void Show() OVERRIDE { 52 virtual void Show() OVERRIDE {
55 native_viewport_->Show(); 53 native_viewport_->Show();
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 186
189 187
190 MOJO_NATIVE_VIEWPORT_EXPORT mojo::Application* 188 MOJO_NATIVE_VIEWPORT_EXPORT mojo::Application*
191 CreateNativeViewportService(mojo::shell::Context* context, 189 CreateNativeViewportService(mojo::shell::Context* context,
192 mojo::ScopedMessagePipeHandle shell_handle) { 190 mojo::ScopedMessagePipeHandle shell_handle) {
193 mojo::Application* app = new mojo::Application(shell_handle.Pass()); 191 mojo::Application* app = new mojo::Application(shell_handle.Pass());
194 app->AddService<mojo::services::NativeViewportImpl>(context); 192 app->AddService<mojo::services::NativeViewportImpl>(context);
195 return app; 193 return app;
196 } 194 }
197 195
OLDNEW
« no previous file with comments | « mojo/services/dbus_echo/dbus_echo_service.cc ('k') | mojo/services/view_manager/view_manager_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698