| OLD | NEW | 
|---|
|  | (Empty) | 
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |  | 
| 2 // Use of this source code is governed by a BSD-style license that can be |  | 
| 3 // found in the LICENSE file. |  | 
| 4 |  | 
| 5 #ifndef COMPONENTS_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_ |  | 
| 6 #define COMPONENTS_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_ |  | 
| 7 |  | 
| 8 #include "components/view_manager/public/interfaces/view_manager_constants.mojom
    .h" |  | 
| 9 |  | 
| 10 namespace gfx { |  | 
| 11 class Rect; |  | 
| 12 } |  | 
| 13 |  | 
| 14 namespace mojo { |  | 
| 15 class ViewportMetrics; |  | 
| 16 } |  | 
| 17 |  | 
| 18 namespace ui { |  | 
| 19 struct TextInputState; |  | 
| 20 } |  | 
| 21 |  | 
| 22 namespace view_manager { |  | 
| 23 |  | 
| 24 class ServerView; |  | 
| 25 |  | 
| 26 // TODO(sky): rename to OnDid and OnWill everywhere. |  | 
| 27 class ServerViewObserver { |  | 
| 28  public: |  | 
| 29   // Invoked when a view is about to be destroyed; before any of the children |  | 
| 30   // have been removed and before the view has been removed from its parent. |  | 
| 31   virtual void OnWillDestroyView(ServerView* view) {} |  | 
| 32 |  | 
| 33   // Invoked at the end of the View's destructor (after it has been removed from |  | 
| 34   // the hierarchy). |  | 
| 35   virtual void OnViewDestroyed(ServerView* view) {} |  | 
| 36 |  | 
| 37   virtual void OnWillChangeViewHierarchy(ServerView* view, |  | 
| 38                                          ServerView* new_parent, |  | 
| 39                                          ServerView* old_parent) {} |  | 
| 40 |  | 
| 41   virtual void OnViewHierarchyChanged(ServerView* view, |  | 
| 42                                       ServerView* new_parent, |  | 
| 43                                       ServerView* old_parent) {} |  | 
| 44 |  | 
| 45   virtual void OnViewBoundsChanged(ServerView* view, |  | 
| 46                                    const gfx::Rect& old_bounds, |  | 
| 47                                    const gfx::Rect& new_bounds) {} |  | 
| 48 |  | 
| 49   virtual void OnViewReordered(ServerView* view, |  | 
| 50                                ServerView* relative, |  | 
| 51                                mojo::OrderDirection direction) {} |  | 
| 52 |  | 
| 53   virtual void OnWillChangeViewVisibility(ServerView* view) {} |  | 
| 54   virtual void OnViewVisibilityChanged(ServerView* view) {} |  | 
| 55 |  | 
| 56   virtual void OnViewTextInputStateChanged(ServerView* view, |  | 
| 57                                            const ui::TextInputState& state) {} |  | 
| 58 |  | 
| 59   virtual void OnViewSharedPropertyChanged( |  | 
| 60       ServerView* view, |  | 
| 61       const std::string& name, |  | 
| 62       const std::vector<uint8_t>* new_data) {} |  | 
| 63 |  | 
| 64  protected: |  | 
| 65   virtual ~ServerViewObserver() {} |  | 
| 66 }; |  | 
| 67 |  | 
| 68 }  // namespace view_manager |  | 
| 69 |  | 
| 70 #endif  // COMPONENTS_VIEW_MANAGER_SERVER_VIEW_OBSERVER_H_ |  | 
| OLD | NEW | 
|---|