| 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_VIEW_MANAGER_DELEGATE_H_ | 5 #ifndef COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ |
| 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ | 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "components/view_manager/public/interfaces/view_manager.mojom.h" | 10 #include "components/view_manager/public/interfaces/view_manager.mojom.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // the pipes connecting |services| and |exposed_services| to the embedder and | 43 // the pipes connecting |services| and |exposed_services| to the embedder and |
| 44 // any services obtained from them are not broken and will continue to be | 44 // any services obtained from them are not broken and will continue to be |
| 45 // valid. | 45 // valid. |
| 46 virtual void OnEmbed(View* root) = 0; | 46 virtual void OnEmbed(View* root) = 0; |
| 47 | 47 |
| 48 // Sent when another app is embedded in the same View as this connection. | 48 // Sent when another app is embedded in the same View as this connection. |
| 49 // Subsequently the root View and this object are destroyed (observers are | 49 // Subsequently the root View and this object are destroyed (observers are |
| 50 // notified appropriately). | 50 // notified appropriately). |
| 51 virtual void OnUnembed(); | 51 virtual void OnUnembed(); |
| 52 | 52 |
| 53 // Sent when GPU resources are returned to the client for reuse. |
| 54 virtual void OnResourcesReturned( |
| 55 mojo::Array<mojo::ReturnedResourcePtr> resources); |
| 56 |
| 53 // Only invoked if the connection has been marked as an embed root. This | 57 // Only invoked if the connection has been marked as an embed root. This |
| 54 // allows the delegate to disallow the embed (return false), or change | 58 // allows the delegate to disallow the embed (return false), or change |
| 55 // the ServiceProviders that would be exposed to the new client. | 59 // the ServiceProviders that would be exposed to the new client. |
| 56 // | 60 // |
| 57 // This implementation returns true (allowing the embed), and does not alter | 61 // This implementation returns true (allowing the embed), and does not alter |
| 58 // the supplied ServiceProviders. | 62 // the supplied ServiceProviders. |
| 59 // | 63 // |
| 60 // See the mojom for more details. | 64 // See the mojom for more details. |
| 61 virtual void OnEmbedForDescendant(View* view, | 65 virtual void OnEmbedForDescendant(View* view, |
| 62 URLRequestPtr request, | 66 URLRequestPtr request, |
| 63 ViewManagerClientPtr* client); | 67 ViewManagerClientPtr* client); |
| 64 | 68 |
| 65 // Called from the destructor of ViewManager after all the Views have been | 69 // Called from the destructor of ViewManager after all the Views have been |
| 66 // destroyed. |view_manager| is no longer valid after this call. | 70 // destroyed. |view_manager| is no longer valid after this call. |
| 67 virtual void OnViewManagerDestroyed(ViewManager* view_manager) = 0; | 71 virtual void OnViewManagerDestroyed(ViewManager* view_manager) = 0; |
| 68 | 72 |
| 69 protected: | 73 protected: |
| 70 virtual ~ViewManagerDelegate() {} | 74 virtual ~ViewManagerDelegate() {} |
| 71 }; | 75 }; |
| 72 | 76 |
| 73 } // namespace mojo | 77 } // namespace mojo |
| 74 | 78 |
| 75 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ | 79 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_MANAGER_DELEGATE_H_ |
| OLD | NEW |