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/public/cpp/view_manager/lib/view_manager_client_impl.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 if (view) | 334 if (view) |
335 view->SetVisible(visible); | 335 view->SetVisible(visible); |
336 } | 336 } |
337 | 337 |
338 void ViewManagerClientImpl::OnViewDrawnStateChanged(Id view_id, bool drawn) { | 338 void ViewManagerClientImpl::OnViewDrawnStateChanged(Id view_id, bool drawn) { |
339 View* view = GetViewById(view_id); | 339 View* view = GetViewById(view_id); |
340 if (view) | 340 if (view) |
341 ViewPrivate(view).LocalSetDrawn(drawn); | 341 ViewPrivate(view).LocalSetDrawn(drawn); |
342 } | 342 } |
343 | 343 |
344 void ViewManagerClientImpl::OnViewPropertyChanged( | 344 void ViewManagerClientImpl::OnViewSharedPropertyChanged( |
345 Id view_id, | 345 Id view_id, |
346 const String& name, | 346 const String& name, |
347 Array<uint8_t> new_data) { | 347 Array<uint8_t> new_data) { |
348 View* view = GetViewById(view_id); | 348 View* view = GetViewById(view_id); |
349 if (view) { | 349 if (view) { |
350 std::vector<uint8_t> data; | 350 std::vector<uint8_t> data; |
351 std::vector<uint8_t>* data_ptr = NULL; | 351 std::vector<uint8_t>* data_ptr = NULL; |
352 if (!new_data.is_null()) { | 352 if (!new_data.is_null()) { |
353 data = new_data.To<std::vector<uint8_t>>(); | 353 data = new_data.To<std::vector<uint8_t>>(); |
354 data_ptr = &data; | 354 data_ptr = &data; |
355 } | 355 } |
356 | 356 |
357 view->SetProperty(name, data_ptr); | 357 view->SetSharedProperty(name, data_ptr); |
358 } | 358 } |
359 } | 359 } |
360 | 360 |
361 void ViewManagerClientImpl::OnViewInputEvent( | 361 void ViewManagerClientImpl::OnViewInputEvent( |
362 Id view_id, | 362 Id view_id, |
363 EventPtr event, | 363 EventPtr event, |
364 const Callback<void()>& ack_callback) { | 364 const Callback<void()>& ack_callback) { |
365 View* view = GetViewById(view_id); | 365 View* view = GetViewById(view_id); |
366 if (view) { | 366 if (view) { |
367 FOR_EACH_OBSERVER(ViewObserver, | 367 FOR_EACH_OBSERVER(ViewObserver, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 base::Unretained(this)); | 427 base::Unretained(this)); |
428 } | 428 } |
429 | 429 |
430 base::Callback<void(ErrorCode)> | 430 base::Callback<void(ErrorCode)> |
431 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { | 431 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { |
432 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, | 432 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, |
433 base::Unretained(this)); | 433 base::Unretained(this)); |
434 } | 434 } |
435 | 435 |
436 } // namespace mojo | 436 } // namespace mojo |
OLD | NEW |