| 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 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_OBSERVER_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_OBSERVER_H_ |
| 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_OBSERVER_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 const Rect& old_bounds, | 56 const Rect& old_bounds, |
| 57 const Rect& new_bounds) {} | 57 const Rect& new_bounds) {} |
| 58 | 58 |
| 59 virtual void OnViewFocusChanged(View* gained_focus, View* lost_focus) {} | 59 virtual void OnViewFocusChanged(View* gained_focus, View* lost_focus) {} |
| 60 | 60 |
| 61 virtual void OnViewInputEvent(View* view, const EventPtr& event) {} | 61 virtual void OnViewInputEvent(View* view, const EventPtr& event) {} |
| 62 | 62 |
| 63 virtual void OnViewVisibilityChanging(View* view) {} | 63 virtual void OnViewVisibilityChanging(View* view) {} |
| 64 virtual void OnViewVisibilityChanged(View* view) {} | 64 virtual void OnViewVisibilityChanged(View* view) {} |
| 65 | 65 |
| 66 virtual void OnViewPropertyChanged(View* view, | 66 // Invoked when this View's shared properties have changed. This can either |
| 67 const std::string& name, | 67 // be caused by SetSharedProperty() being called locally, or by us receiving |
| 68 const std::vector<uint8_t>* old_data, | 68 // a mojo message that this property has changed. If this property has been |
| 69 const std::vector<uint8_t>* new_data) {} | 69 // added, |old_data| is null. If this property was removed, |new_data| is |
| 70 // null. |
| 71 virtual void OnViewSharedPropertyChanged( |
| 72 View* view, |
| 73 const std::string& name, |
| 74 const std::vector<uint8_t>* old_data, |
| 75 const std::vector<uint8_t>* new_data) {} |
| 76 |
| 77 // Invoked when SetProperty() or ClearProperty() is called on the window. |
| 78 // |key| is either a WindowProperty<T>* (SetProperty, ClearProperty). Either |
| 79 // way, it can simply be compared for equality with the property |
| 80 // constant. |old| is the old property value, which must be cast to the |
| 81 // appropriate type before use. |
| 82 virtual void OnViewLocalPropertyChanged( |
| 83 View* view, |
| 84 const void* key, |
| 85 intptr_t old) {} |
| 70 | 86 |
| 71 virtual void OnViewEmbeddedAppDisconnected(View* view) {} | 87 virtual void OnViewEmbeddedAppDisconnected(View* view) {} |
| 72 | 88 |
| 73 // Sent when the drawn state changes. This is only sent for the root nodes | 89 // Sent when the drawn state changes. This is only sent for the root nodes |
| 74 // when embedded. | 90 // when embedded. |
| 75 virtual void OnViewDrawnChanging(View* view) {} | 91 virtual void OnViewDrawnChanging(View* view) {} |
| 76 virtual void OnViewDrawnChanged(View* view) {} | 92 virtual void OnViewDrawnChanged(View* view) {} |
| 77 | 93 |
| 78 protected: | 94 protected: |
| 79 virtual ~ViewObserver() {} | 95 virtual ~ViewObserver() {} |
| 80 }; | 96 }; |
| 81 | 97 |
| 82 } // namespace mojo | 98 } // namespace mojo |
| 83 | 99 |
| 84 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_OBSERVER_H_ | 100 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_VIEW_OBSERVER_H_ |
| OLD | NEW |