| 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_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 5 #ifndef MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 6 #define MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 bool OwnsNode(Id id) const; | 53 bool OwnsNode(Id id) const; |
| 54 bool OwnsView(Id id) const; | 54 bool OwnsView(Id id) const; |
| 55 | 55 |
| 56 void SetActiveView(Id node_id, Id view_id); | 56 void SetActiveView(Id node_id, Id view_id); |
| 57 void SetBounds(Id node_id, const gfx::Rect& bounds); | 57 void SetBounds(Id node_id, const gfx::Rect& bounds); |
| 58 void SetViewContents(Id view_id, const SkBitmap& contents); | 58 void SetViewContents(Id view_id, const SkBitmap& contents); |
| 59 void SetFocus(Id node_id); | 59 void SetFocus(Id node_id); |
| 60 void SetVisible(Id node_id, bool visible); | 60 void SetVisible(Id node_id, bool visible); |
| 61 | 61 |
| 62 void Embed(const String& url, Id node_id); | 62 void Embed(const String& url, Id node_id); |
| 63 void Embed(const String& url, |
| 64 Id node_id, |
| 65 ServiceProviderPtr service_provider); |
| 63 | 66 |
| 64 void set_change_acked_callback(const base::Callback<void(void)>& callback) { | 67 void set_change_acked_callback(const base::Callback<void(void)>& callback) { |
| 65 change_acked_callback_ = callback; | 68 change_acked_callback_ = callback; |
| 66 } | 69 } |
| 67 void ClearChangeAckedCallback() { | 70 void ClearChangeAckedCallback() { |
| 68 change_acked_callback_ = base::Callback<void(void)>(); | 71 change_acked_callback_ = base::Callback<void(void)>(); |
| 69 } | 72 } |
| 70 | 73 |
| 71 // Start/stop tracking nodes & views. While tracked, they can be retrieved via | 74 // Start/stop tracking nodes & views. While tracked, they can be retrieved via |
| 72 // ViewManager::GetNode/ViewById. | 75 // ViewManager::GetNode/ViewById. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 90 virtual const std::vector<Node*>& GetRoots() const OVERRIDE; | 93 virtual const std::vector<Node*>& GetRoots() const OVERRIDE; |
| 91 virtual Node* GetNodeById(Id id) OVERRIDE; | 94 virtual Node* GetNodeById(Id id) OVERRIDE; |
| 92 virtual View* GetViewById(Id id) OVERRIDE; | 95 virtual View* GetViewById(Id id) OVERRIDE; |
| 93 | 96 |
| 94 // Overridden from InterfaceImpl: | 97 // Overridden from InterfaceImpl: |
| 95 virtual void OnConnectionEstablished() OVERRIDE; | 98 virtual void OnConnectionEstablished() OVERRIDE; |
| 96 | 99 |
| 97 // Overridden from ViewManagerClient: | 100 // Overridden from ViewManagerClient: |
| 98 virtual void OnEmbed(ConnectionSpecificId connection_id, | 101 virtual void OnEmbed(ConnectionSpecificId connection_id, |
| 99 const String& creator_url, | 102 const String& creator_url, |
| 100 NodeDataPtr root) OVERRIDE; | 103 NodeDataPtr root, |
| 104 InterfaceRequest<ServiceProvider> services) OVERRIDE; |
| 101 virtual void OnNodeBoundsChanged(Id node_id, | 105 virtual void OnNodeBoundsChanged(Id node_id, |
| 102 RectPtr old_bounds, | 106 RectPtr old_bounds, |
| 103 RectPtr new_bounds) OVERRIDE; | 107 RectPtr new_bounds) OVERRIDE; |
| 104 virtual void OnNodeHierarchyChanged(Id node_id, | 108 virtual void OnNodeHierarchyChanged(Id node_id, |
| 105 Id new_parent_id, | 109 Id new_parent_id, |
| 106 Id old_parent_id, | 110 Id old_parent_id, |
| 107 Array<NodeDataPtr> nodes) OVERRIDE; | 111 Array<NodeDataPtr> nodes) OVERRIDE; |
| 108 virtual void OnNodeReordered(Id node_id, | 112 virtual void OnNodeReordered(Id node_id, |
| 109 Id relative_node_id, | 113 Id relative_node_id, |
| 110 OrderDirection direction) OVERRIDE; | 114 OrderDirection direction) OVERRIDE; |
| 111 virtual void OnNodeDeleted(Id node_id) OVERRIDE; | 115 virtual void OnNodeDeleted(Id node_id) OVERRIDE; |
| 112 virtual void OnNodeViewReplaced(Id node, | 116 virtual void OnNodeViewReplaced(Id node, |
| 113 Id new_view_id, | 117 Id new_view_id, |
| 114 Id old_view_id) OVERRIDE; | 118 Id old_view_id) OVERRIDE; |
| 115 virtual void OnViewDeleted(Id view_id) OVERRIDE; | 119 virtual void OnViewDeleted(Id view_id) OVERRIDE; |
| 116 virtual void OnViewInputEvent(Id view, | 120 virtual void OnViewInputEvent(Id view, |
| 117 EventPtr event, | 121 EventPtr event, |
| 118 const Callback<void()>& callback) OVERRIDE; | 122 const Callback<void()>& callback) OVERRIDE; |
| 119 virtual void OnFocusChanged(Id gained_focus_id, Id lost_focus_id) OVERRIDE; | 123 virtual void OnFocusChanged(Id gained_focus_id, Id lost_focus_id) OVERRIDE; |
| 120 virtual void Embed(const String& url) OVERRIDE; | 124 virtual void Embed( |
| 125 const String& url, |
| 126 InterfaceRequest<ServiceProvider> service_provider) OVERRIDE; |
| 121 virtual void DispatchOnViewInputEvent(Id view_id, EventPtr event) OVERRIDE; | 127 virtual void DispatchOnViewInputEvent(Id view_id, EventPtr event) OVERRIDE; |
| 122 | 128 |
| 123 void AddRoot(Node* root); | |
| 124 void RemoveRoot(Node* root); | 129 void RemoveRoot(Node* root); |
| 125 | 130 |
| 126 void OnActionCompleted(bool success); | 131 void OnActionCompleted(bool success); |
| 127 void OnActionCompletedWithErrorCode(ErrorCode code); | 132 void OnActionCompletedWithErrorCode(ErrorCode code); |
| 128 | 133 |
| 129 base::Callback<void(bool)> ActionCompletedCallback(); | 134 base::Callback<void(bool)> ActionCompletedCallback(); |
| 130 base::Callback<void(ErrorCode)> ActionCompletedCallbackWithErrorCode(); | 135 base::Callback<void(ErrorCode)> ActionCompletedCallbackWithErrorCode(); |
| 131 | 136 |
| 132 bool connected_; | 137 bool connected_; |
| 133 ConnectionSpecificId connection_id_; | 138 ConnectionSpecificId connection_id_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 146 IdToViewMap views_; | 151 IdToViewMap views_; |
| 147 | 152 |
| 148 ViewManagerService* service_; | 153 ViewManagerService* service_; |
| 149 | 154 |
| 150 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); | 155 DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); |
| 151 }; | 156 }; |
| 152 | 157 |
| 153 } // namespace mojo | 158 } // namespace mojo |
| 154 | 159 |
| 155 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 160 #endif // MOJO_SERVICES_PUBLIC_CPP_VIEW_MANAGER_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| OLD | NEW |