OLD | NEW |
| 1 |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 4 // found in the LICENSE file. |
4 | 5 |
5 #include "mojo/services/window_manager/window_manager_service_impl.h" | 6 #include "mojo/services/window_manager/window_manager_service_impl.h" |
6 | 7 |
7 #include "mojo/services/window_manager/window_manager_app.h" | 8 #include "mojo/services/window_manager/window_manager_app.h" |
8 | 9 |
9 namespace mojo { | 10 namespace mojo { |
10 | 11 |
11 //////////////////////////////////////////////////////////////////////////////// | 12 //////////////////////////////////////////////////////////////////////////////// |
12 // WindowManagerServiceImpl, public: | 13 // WindowManagerServiceImpl, public: |
13 | 14 |
14 WindowManagerServiceImpl::WindowManagerServiceImpl( | 15 WindowManagerServiceImpl::WindowManagerServiceImpl( |
15 WindowManagerApp* window_manager) | 16 WindowManagerApp* window_manager) |
16 : window_manager_(window_manager) { | 17 : window_manager_(window_manager) { |
17 window_manager_->AddConnection(this); | 18 window_manager_->AddConnection(this); |
18 } | 19 } |
19 | 20 |
20 WindowManagerServiceImpl::~WindowManagerServiceImpl() { | 21 WindowManagerServiceImpl::~WindowManagerServiceImpl() { |
21 window_manager_->RemoveConnection(this); | 22 window_manager_->RemoveConnection(this); |
22 } | 23 } |
23 | 24 |
24 void WindowManagerServiceImpl::NotifyReady() { | 25 void WindowManagerServiceImpl::NotifyReady() { |
25 client()->OnWindowManagerReady(); | 26 client()->OnWindowManagerReady(); |
26 } | 27 } |
27 | 28 |
28 void WindowManagerServiceImpl::NotifyNodeFocused(Id new_focused_id, | 29 void WindowManagerServiceImpl::NotifyViewFocused(Id new_focused_id, |
29 Id old_focused_id) { | 30 Id old_focused_id) { |
30 client()->OnFocusChanged(old_focused_id, new_focused_id); | 31 client()->OnFocusChanged(old_focused_id, new_focused_id); |
31 } | 32 } |
32 | 33 |
33 void WindowManagerServiceImpl::NotifyWindowActivated(Id new_active_id, | 34 void WindowManagerServiceImpl::NotifyWindowActivated(Id new_active_id, |
34 Id old_active_id) { | 35 Id old_active_id) { |
35 client()->OnActiveWindowChanged(old_active_id, new_active_id); | 36 client()->OnActiveWindowChanged(old_active_id, new_active_id); |
36 } | 37 } |
37 | 38 |
38 //////////////////////////////////////////////////////////////////////////////// | 39 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 96 |
96 void WindowManagerServiceImpl::OnConnectionEstablished() { | 97 void WindowManagerServiceImpl::OnConnectionEstablished() { |
97 // If the connection was established prior to the window manager being | 98 // If the connection was established prior to the window manager being |
98 // embedded by the view manager, |window_manager_|'s ViewManagerDelegate | 99 // embedded by the view manager, |window_manager_|'s ViewManagerDelegate |
99 // impl will call NotifyReady() when it is. | 100 // impl will call NotifyReady() when it is. |
100 if (window_manager_->IsReady()) | 101 if (window_manager_->IsReady()) |
101 NotifyReady(); | 102 NotifyReady(); |
102 } | 103 } |
103 | 104 |
104 } // namespace mojo | 105 } // namespace mojo |
OLD | NEW |