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

Side by Side Diff: mojo/services/view_manager/public/cpp/lib/view_manager_client_impl.cc

Issue 945273002: Fixes bad code in OnViewVisibilityChanged (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
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 "view_manager/public/cpp/lib/view_manager_client_impl.h" 5 #include "view_manager/public/cpp/lib/view_manager_client_impl.h"
6 6
7 #include "mojo/public/cpp/application/application_impl.h" 7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "mojo/public/cpp/application/connect.h" 8 #include "mojo/public/cpp/application/connect.h"
9 #include "mojo/public/cpp/application/service_provider_impl.h" 9 #include "mojo/public/cpp/application/service_provider_impl.h"
10 #include "mojo/public/interfaces/application/service_provider.mojom.h" 10 #include "mojo/public/interfaces/application/service_provider.mojom.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 if (view) 372 if (view)
373 ViewPrivate(view).LocalDestroy(); 373 ViewPrivate(view).LocalDestroy();
374 } 374 }
375 375
376 void ViewManagerClientImpl::OnViewVisibilityChanged(Id view_id, bool visible) { 376 void ViewManagerClientImpl::OnViewVisibilityChanged(Id view_id, bool visible) {
377 // TODO(sky): there is a race condition here. If this client and another 377 // TODO(sky): there is a race condition here. If this client and another
378 // client change the visibility at the same time the wrong value may be set. 378 // client change the visibility at the same time the wrong value may be set.
379 // Deal with this some how. 379 // Deal with this some how.
380 View* view = GetViewById(view_id); 380 View* view = GetViewById(view_id);
381 if (view) 381 if (view)
382 view->SetVisible(visible); 382 ViewPrivate(view).LocalSetVisible(visible);
383 } 383 }
384 384
385 void ViewManagerClientImpl::OnViewDrawnStateChanged(Id view_id, bool drawn) { 385 void ViewManagerClientImpl::OnViewDrawnStateChanged(Id view_id, bool drawn) {
386 View* view = GetViewById(view_id); 386 View* view = GetViewById(view_id);
387 if (view) 387 if (view)
388 ViewPrivate(view).LocalSetDrawn(drawn); 388 ViewPrivate(view).LocalSetDrawn(drawn);
389 } 389 }
390 390
391 void ViewManagerClientImpl::OnViewSharedPropertyChanged( 391 void ViewManagerClientImpl::OnViewSharedPropertyChanged(
392 Id view_id, 392 Id view_id,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 void ViewManagerClientImpl::OnActionCompleted(bool success) { 487 void ViewManagerClientImpl::OnActionCompleted(bool success) {
488 if (!change_acked_callback_.is_null()) 488 if (!change_acked_callback_.is_null())
489 change_acked_callback_.Run(); 489 change_acked_callback_.Run();
490 } 490 }
491 491
492 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() { 492 Callback<void(bool)> ViewManagerClientImpl::ActionCompletedCallback() {
493 return [this](bool success) { OnActionCompleted(success); }; 493 return [this](bool success) { OnActionCompleted(success); };
494 } 494 }
495 495
496 } // namespace mojo 496 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/view_manager/public/cpp/lib/view.cc ('k') | mojo/services/view_manager/public/cpp/lib/view_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698