| 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 COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 5 #ifndef COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "components/view_manager/public/cpp/types.h" | 8 #include "components/view_manager/public/cpp/types.h" |
| 9 #include "components/view_manager/public/cpp/view.h" | 9 #include "components/view_manager/public/cpp/view.h" |
| 10 #include "components/view_manager/public/cpp/view_manager.h" | 10 #include "components/view_manager/public/cpp/view_manager.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 bool is_embed_root() const { return is_embed_root_; } | 76 bool is_embed_root() const { return is_embed_root_; } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 class RootObserver; | 79 class RootObserver; |
| 80 | 80 |
| 81 typedef std::map<Id, View*> IdToViewMap; | 81 typedef std::map<Id, View*> IdToViewMap; |
| 82 | 82 |
| 83 Id CreateViewOnServer(); | 83 Id CreateViewOnServer(); |
| 84 | 84 |
| 85 // Overridden from ViewManager: | 85 // Overridden from ViewManager: |
| 86 const std::string& GetEmbedderURL() const override; | |
| 87 View* GetRoot() override; | 86 View* GetRoot() override; |
| 88 View* GetViewById(Id id) override; | 87 View* GetViewById(Id id) override; |
| 89 View* GetFocusedView() override; | 88 View* GetFocusedView() override; |
| 90 View* CreateView() override; | 89 View* CreateView() override; |
| 91 void SetEmbedRoot() override; | 90 void SetEmbedRoot() override; |
| 92 | 91 |
| 93 // Overridden from ViewManagerClient: | 92 // Overridden from ViewManagerClient: |
| 94 void OnEmbed(ConnectionSpecificId connection_id, | 93 void OnEmbed(ConnectionSpecificId connection_id, |
| 95 const String& creator_url, | |
| 96 ViewDataPtr root, | 94 ViewDataPtr root, |
| 97 ViewManagerServicePtr view_manager_service, | 95 ViewManagerServicePtr view_manager_service, |
| 98 InterfaceRequest<ServiceProvider> services, | |
| 99 ServiceProviderPtr exposed_services, | |
| 100 Id focused_view_id) override; | 96 Id focused_view_id) override; |
| 101 void OnWillEmbed(Id view, | 97 void OnEmbedForDescendant( |
| 102 InterfaceRequest<ServiceProvider> services, | 98 Id view, |
| 103 ServiceProviderPtr exposed_services, | 99 mojo::URLRequestPtr request, |
| 104 const OnWillEmbedCallback& callback) override; | 100 const OnEmbedForDescendantCallback& callback) override; |
| 105 void OnEmbeddedAppDisconnected(Id view_id) override; | 101 void OnEmbeddedAppDisconnected(Id view_id) override; |
| 106 void OnViewBoundsChanged(Id view_id, | 102 void OnViewBoundsChanged(Id view_id, |
| 107 RectPtr old_bounds, | 103 RectPtr old_bounds, |
| 108 RectPtr new_bounds) override; | 104 RectPtr new_bounds) override; |
| 109 void OnViewViewportMetricsChanged(ViewportMetricsPtr old_metrics, | 105 void OnViewViewportMetricsChanged(ViewportMetricsPtr old_metrics, |
| 110 ViewportMetricsPtr new_metrics) override; | 106 ViewportMetricsPtr new_metrics) override; |
| 111 void OnViewHierarchyChanged(Id view_id, | 107 void OnViewHierarchyChanged(Id view_id, |
| 112 Id new_parent_id, | 108 Id new_parent_id, |
| 113 Id old_parent_id, | 109 Id old_parent_id, |
| 114 Array<ViewDataPtr> views) override; | 110 Array<ViewDataPtr> views) override; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 131 | 127 |
| 132 void RootDestroyed(View* root); | 128 void RootDestroyed(View* root); |
| 133 | 129 |
| 134 void OnActionCompleted(bool success); | 130 void OnActionCompleted(bool success); |
| 135 | 131 |
| 136 Callback<void(bool)> ActionCompletedCallback(); | 132 Callback<void(bool)> ActionCompletedCallback(); |
| 137 | 133 |
| 138 ConnectionSpecificId connection_id_; | 134 ConnectionSpecificId connection_id_; |
| 139 ConnectionSpecificId next_id_; | 135 ConnectionSpecificId next_id_; |
| 140 | 136 |
| 141 std::string creator_url_; | |
| 142 | |
| 143 Callback<void(void)> change_acked_callback_; | 137 Callback<void(void)> change_acked_callback_; |
| 144 | 138 |
| 145 ViewManagerDelegate* delegate_; | 139 ViewManagerDelegate* delegate_; |
| 146 | 140 |
| 147 View* root_; | 141 View* root_; |
| 148 | 142 |
| 149 IdToViewMap views_; | 143 IdToViewMap views_; |
| 150 | 144 |
| 151 View* capture_view_; | 145 View* capture_view_; |
| 152 View* focused_view_; | 146 View* focused_view_; |
| 153 View* activated_view_; | 147 View* activated_view_; |
| 154 | 148 |
| 155 Binding<ViewManagerClient> binding_; | 149 Binding<ViewManagerClient> binding_; |
| 156 ViewManagerServicePtr service_; | 150 ViewManagerServicePtr service_; |
| 157 | 151 |
| 158 scoped_ptr<RootObserver> root_observer_; | 152 scoped_ptr<RootObserver> root_observer_; |
| 159 | 153 |
| 160 bool is_embed_root_; | 154 bool is_embed_root_; |
| 161 | 155 |
| 162 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); | 156 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewManagerClientImpl); |
| 163 }; | 157 }; |
| 164 | 158 |
| 165 } // namespace mojo | 159 } // namespace mojo |
| 166 | 160 |
| 167 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ | 161 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_LIB_VIEW_MANAGER_CLIENT_IMPL_H_ |
| OLD | NEW |