| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/window_manager/window_manager_app.h" | 5 #include "mojo/services/window_manager/window_manager_app.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "mojo/aura/aura_init.h" | 9 #include "mojo/aura/aura_init.h" |
| 10 #include "mojo/converters/geometry/geometry_type_converters.h" | 10 #include "mojo/converters/geometry/geometry_type_converters.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 uint16_t connection_id, | 89 uint16_t connection_id, |
| 90 ScopedMessagePipeHandle window_manager_pipe) override { | 90 ScopedMessagePipeHandle window_manager_pipe) override { |
| 91 // |wm_internal| is tied to the life of the pipe. | 91 // |wm_internal| is tied to the life of the pipe. |
| 92 WindowManagerImpl* wm = new WindowManagerImpl(app_, true); | 92 WindowManagerImpl* wm = new WindowManagerImpl(app_, true); |
| 93 WeakBindToPipe(wm, window_manager_pipe.Pass()); | 93 WeakBindToPipe(wm, window_manager_pipe.Pass()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 // InterfaceImpl: | 96 // InterfaceImpl: |
| 97 void OnConnectionError() override { | 97 void OnConnectionError() override { |
| 98 // Necessary since we used WeakBindToPipe and are not automatically deleted. | 98 // Necessary since we used WeakBindToPipe and are not automatically deleted. |
| 99 // crbug.com/431911 |
| 99 delete this; | 100 delete this; |
| 100 } | 101 } |
| 101 | 102 |
| 102 private: | 103 private: |
| 103 WindowManagerApp* app_; | 104 WindowManagerApp* app_; |
| 104 | 105 |
| 105 DISALLOW_COPY_AND_ASSIGN(WindowManagerInternalImpl); | 106 DISALLOW_COPY_AND_ASSIGN(WindowManagerInternalImpl); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 // Used for calls to Embed() that occur before we've connected to the | 109 // Used for calls to Embed() that occur before we've connected to the |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 view_manager_app->ConnectToService(&window_manager_client_); | 413 view_manager_app->ConnectToService(&window_manager_client_); |
| 413 } | 414 } |
| 414 | 415 |
| 415 void WindowManagerApp::Create(ApplicationConnection* connection, | 416 void WindowManagerApp::Create(ApplicationConnection* connection, |
| 416 InterfaceRequest<WindowManagerInternal> request) { | 417 InterfaceRequest<WindowManagerInternal> request) { |
| 417 WindowManagerInternalImpl* impl = new WindowManagerInternalImpl(this); | 418 WindowManagerInternalImpl* impl = new WindowManagerInternalImpl(this); |
| 418 BindToRequest(impl, &request); | 419 BindToRequest(impl, &request); |
| 419 } | 420 } |
| 420 | 421 |
| 421 } // namespace mojo | 422 } // namespace mojo |
| OLD | NEW |