| 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_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ |
| 6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Invoked when a connection is destroyed. | 70 // Invoked when a connection is destroyed. |
| 71 void OnViewManagerServiceImplDestroyed(ConnectionSpecificId id); | 71 void OnViewManagerServiceImplDestroyed(ConnectionSpecificId id); |
| 72 | 72 |
| 73 // The following methods are invoked after the corresponding change has been | 73 // The following methods are invoked after the corresponding change has been |
| 74 // processed. They do the appropriate bookkeeping and update the client as | 74 // processed. They do the appropriate bookkeeping and update the client as |
| 75 // necessary. | 75 // necessary. |
| 76 void ProcessViewBoundsChanged(const ServerView* view, | 76 void ProcessViewBoundsChanged(const ServerView* view, |
| 77 const gfx::Rect& old_bounds, | 77 const gfx::Rect& old_bounds, |
| 78 const gfx::Rect& new_bounds, | 78 const gfx::Rect& new_bounds, |
| 79 bool originated_change); | 79 bool originated_change); |
| 80 void ProcessWillChangeViewHierarchy(const ServerView* view, |
| 81 const ServerView* new_parent, |
| 82 const ServerView* old_parent, |
| 83 bool originated_change); |
| 80 void ProcessViewHierarchyChanged(const ServerView* view, | 84 void ProcessViewHierarchyChanged(const ServerView* view, |
| 81 const ServerView* new_parent, | 85 const ServerView* new_parent, |
| 82 const ServerView* old_parent, | 86 const ServerView* old_parent, |
| 83 bool originated_change); | 87 bool originated_change); |
| 84 void ProcessViewReorder(const ServerView* view, | 88 void ProcessViewReorder(const ServerView* view, |
| 85 const ServerView* relative_view, | 89 const ServerView* relative_view, |
| 86 OrderDirection direction, | 90 OrderDirection direction, |
| 87 bool originated_change); | 91 bool originated_change); |
| 88 void ProcessViewDeleted(const ViewId& view, bool originated_change); | 92 void ProcessViewDeleted(const ViewId& view, bool originated_change); |
| 93 void ProcessWillChangeViewVisibility(const ServerView* view, |
| 94 bool originated_change); |
| 89 | 95 |
| 90 // TODO(sky): move this to private section (currently can't because of | 96 // TODO(sky): move this to private section (currently can't because of |
| 91 // bindings). | 97 // bindings). |
| 92 // InterfaceImp overrides: | 98 // InterfaceImp overrides: |
| 93 virtual void OnConnectionError() MOJO_OVERRIDE; | 99 virtual void OnConnectionError() MOJO_OVERRIDE; |
| 94 | 100 |
| 95 private: | 101 private: |
| 96 typedef std::map<ConnectionSpecificId, ServerView*> ViewMap; | 102 typedef std::map<ConnectionSpecificId, ServerView*> ViewMap; |
| 97 typedef base::hash_set<Id> ViewIdSet; | 103 typedef base::hash_set<Id> ViewIdSet; |
| 98 | 104 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 129 // see are set to NULL (in the returned ViewData(s)). | 135 // see are set to NULL (in the returned ViewData(s)). |
| 130 Array<ViewDataPtr> ViewsToViewDatas( | 136 Array<ViewDataPtr> ViewsToViewDatas( |
| 131 const std::vector<const ServerView*>& views); | 137 const std::vector<const ServerView*>& views); |
| 132 ViewDataPtr ViewToViewData(const ServerView* view); | 138 ViewDataPtr ViewToViewData(const ServerView* view); |
| 133 | 139 |
| 134 // Implementation of GetViewTree(). Adds |view| to |views| and recurses if | 140 // Implementation of GetViewTree(). Adds |view| to |views| and recurses if |
| 135 // CanDescendIntoViewForViewTree() returns true. | 141 // CanDescendIntoViewForViewTree() returns true. |
| 136 void GetViewTreeImpl(const ServerView* view, | 142 void GetViewTreeImpl(const ServerView* view, |
| 137 std::vector<const ServerView*>* views) const; | 143 std::vector<const ServerView*>* views) const; |
| 138 | 144 |
| 145 // Notify the client if the drawn state of any of the roots changes. |
| 146 // |view| is the view that is changing to the drawn state |new_drawn_value|. |
| 147 void NotifyDrawnStateChanged(const ServerView* view, bool new_drawn_value); |
| 148 |
| 139 // ViewManagerService: | 149 // ViewManagerService: |
| 140 virtual void CreateView(Id transport_view_id, | 150 virtual void CreateView(Id transport_view_id, |
| 141 const Callback<void(ErrorCode)>& callback) OVERRIDE; | 151 const Callback<void(ErrorCode)>& callback) OVERRIDE; |
| 142 virtual void DeleteView(Id transport_view_id, | 152 virtual void DeleteView(Id transport_view_id, |
| 143 const Callback<void(bool)>& callback) OVERRIDE; | 153 const Callback<void(bool)>& callback) OVERRIDE; |
| 144 virtual void AddView(Id parent_id, | 154 virtual void AddView(Id parent_id, |
| 145 Id child_id, | 155 Id child_id, |
| 146 const Callback<void(bool)>& callback) OVERRIDE; | 156 const Callback<void(bool)>& callback) OVERRIDE; |
| 147 virtual void RemoveViewFromParent( | 157 virtual void RemoveViewFromParent( |
| 148 Id view_id, | 158 Id view_id, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 }; | 231 }; |
| 222 | 232 |
| 223 #if defined(OS_WIN) | 233 #if defined(OS_WIN) |
| 224 #pragma warning(pop) | 234 #pragma warning(pop) |
| 225 #endif | 235 #endif |
| 226 | 236 |
| 227 } // namespace service | 237 } // namespace service |
| 228 } // namespace mojo | 238 } // namespace mojo |
| 229 | 239 |
| 230 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ | 240 #endif // MOJO_SERVICES_VIEW_MANAGER_VIEW_MANAGER_SERVICE_IMPL_H_ |
| OLD | NEW |