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

Side by Side Diff: services/window_manager/window_manager_impl.cc

Issue 805123003: Adds capture to the mojo window_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sky comments Created 6 years 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
« no previous file with comments | « services/window_manager/window_manager_impl.h ('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 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 "services/window_manager/window_manager_impl.h" 5 #include "services/window_manager/window_manager_impl.h"
6 6
7 #include "mojo/services/view_manager/public/cpp/view.h" 7 #include "mojo/services/view_manager/public/cpp/view.h"
8 #include "services/window_manager/focus_controller.h" 8 #include "services/window_manager/focus_controller.h"
9 #include "services/window_manager/window_manager_app.h" 9 #include "services/window_manager/window_manager_app.h"
10 10
(...skipping 23 matching lines...) Expand all
34 if (from_vm_) 34 if (from_vm_)
35 client()->OnFocusChanged(old_focused_id, new_focused_id); 35 client()->OnFocusChanged(old_focused_id, new_focused_id);
36 } 36 }
37 37
38 void WindowManagerImpl::NotifyWindowActivated(Id new_active_id, 38 void WindowManagerImpl::NotifyWindowActivated(Id new_active_id,
39 Id old_active_id) { 39 Id old_active_id) {
40 if (from_vm_) 40 if (from_vm_)
41 client()->OnActiveWindowChanged(old_active_id, new_active_id); 41 client()->OnActiveWindowChanged(old_active_id, new_active_id);
42 } 42 }
43 43
44 void WindowManagerImpl::NotifyCaptureChanged(Id new_capture_id,
45 Id old_capture_id) {
46 if (from_vm_)
47 client()->OnCaptureChanged(old_capture_id, new_capture_id);
48 }
49
44 void WindowManagerImpl::Embed( 50 void WindowManagerImpl::Embed(
45 const mojo::String& url, 51 const mojo::String& url,
46 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) { 52 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) {
47 window_manager_->Embed(url, service_provider.Pass()); 53 window_manager_->Embed(url, service_provider.Pass());
48 } 54 }
49 55
50 void WindowManagerImpl::SetCapture(Id view, 56 void WindowManagerImpl::SetCapture(Id view,
51 const Callback<void(bool)>& callback) { 57 const Callback<void(bool)>& callback) {
52 if (!from_vm_) 58 if (!from_vm_)
53 return; // See comments for |from_vm_| on this. 59 return; // See comments for |from_vm_| on this.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // TODO(sky): sanitize ids for client. 100 // TODO(sky): sanitize ids for client.
95 callback.Run(focused_view ? focused_view->id() : 0, 101 callback.Run(focused_view ? focused_view->id() : 0,
96 active_view ? active_view->id() : 0); 102 active_view ? active_view->id() : 0);
97 } 103 }
98 104
99 void WindowManagerImpl::OnConnectionError() { 105 void WindowManagerImpl::OnConnectionError() {
100 delete this; 106 delete this;
101 } 107 }
102 108
103 } // namespace window_manager 109 } // namespace window_manager
OLDNEW
« no previous file with comments | « services/window_manager/window_manager_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698