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/view.h" | 5 #include "mojo/services/public/cpp/view_manager/view.h" |
6 | 6 |
7 #include "mojo/public/cpp/application/service_provider_impl.h" | 7 #include "mojo/public/cpp/application/service_provider_impl.h" |
8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" | 8 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" |
9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" | 9 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" |
10 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 10 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDestroyed(this)); | 417 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDestroyed(this)); |
418 } | 418 } |
419 | 419 |
420 //////////////////////////////////////////////////////////////////////////////// | 420 //////////////////////////////////////////////////////////////////////////////// |
421 // View, private: | 421 // View, private: |
422 | 422 |
423 View::View(ViewManager* manager) | 423 View::View(ViewManager* manager) |
424 : manager_(manager), | 424 : manager_(manager), |
425 id_(static_cast<ViewManagerClientImpl*>(manager_)->CreateView()), | 425 id_(static_cast<ViewManagerClientImpl*>(manager_)->CreateView()), |
426 parent_(NULL), | 426 parent_(NULL), |
427 visible_(true), | 427 visible_(false), |
428 drawn_(false) { | 428 drawn_(false) { |
429 } | 429 } |
430 | 430 |
431 int64 View::SetLocalPropertyInternal(const void* key, | 431 int64 View::SetLocalPropertyInternal(const void* key, |
432 const char* name, | 432 const char* name, |
433 PropertyDeallocator deallocator, | 433 PropertyDeallocator deallocator, |
434 int64 value, | 434 int64 value, |
435 int64 default_value) { | 435 int64 default_value) { |
436 int64 old = GetLocalPropertyInternal(key, default_value); | 436 int64 old = GetLocalPropertyInternal(key, default_value); |
437 if (value == default_value) { | 437 if (value == default_value) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 if (IsDrawn() == value) { | 497 if (IsDrawn() == value) { |
498 drawn_ = value; | 498 drawn_ = value; |
499 return; | 499 return; |
500 } | 500 } |
501 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanging(this)); | 501 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanging(this)); |
502 drawn_ = value; | 502 drawn_ = value; |
503 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanged(this)); | 503 FOR_EACH_OBSERVER(ViewObserver, observers_, OnViewDrawnChanged(this)); |
504 } | 504 } |
505 | 505 |
506 } // namespace mojo | 506 } // namespace mojo |
OLD | NEW |