| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_WEB_VIEW_FRAME_TREE_DELEGATE_H_ | 5 #ifndef COMPONENTS_WEB_VIEW_FRAME_TREE_DELEGATE_H_ |
| 6 #define COMPONENTS_WEB_VIEW_FRAME_TREE_DELEGATE_H_ | 6 #define COMPONENTS_WEB_VIEW_FRAME_TREE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // |EXISTING_FRAME| then |target_frame| identifies the frame to perform the | 44 // |EXISTING_FRAME| then |target_frame| identifies the frame to perform the |
| 45 // navigation in, otherwise |target_frame| is not used. |target_frame| may | 45 // navigation in, otherwise |target_frame| is not used. |target_frame| may |
| 46 // be null, even for |EXISTING_FRAME|. | 46 // be null, even for |EXISTING_FRAME|. |
| 47 // TODO(sky): this needs to distinguish between navigate in source, vs new | 47 // TODO(sky): this needs to distinguish between navigate in source, vs new |
| 48 // background tab, vs new foreground tab. | 48 // background tab, vs new foreground tab. |
| 49 virtual void NavigateTopLevel(Frame* source, mojo::URLRequestPtr request) = 0; | 49 virtual void NavigateTopLevel(Frame* source, mojo::URLRequestPtr request) = 0; |
| 50 | 50 |
| 51 // Asks the client if navigation is allowed. If the navigation is allowed | 51 // Asks the client if navigation is allowed. If the navigation is allowed |
| 52 // |callback| should be called to continue the navigation. |callback| | 52 // |callback| should be called to continue the navigation. |callback| |
| 53 // may be called synchronously or asynchronously. In the callback | 53 // may be called synchronously or asynchronously. In the callback |
| 54 // mojo::ViewTreeClientPtr should only be set if an app other than | 54 // ViewTreeClientPtr should only be set if an app other than |
| 55 // frame->app_id() is used to render |request|. | 55 // frame->app_id() is used to render |request|. |
| 56 virtual void CanNavigateFrame(Frame* target, | 56 virtual void CanNavigateFrame(Frame* target, |
| 57 mojo::URLRequestPtr request, | 57 mojo::URLRequestPtr request, |
| 58 const CanNavigateFrameCallback& callback) = 0; | 58 const CanNavigateFrameCallback& callback) = 0; |
| 59 | 59 |
| 60 // Invoked when a navigation in |frame| has been initiated. | 60 // Invoked when a navigation in |frame| has been initiated. |
| 61 virtual void DidStartNavigation(Frame* frame) = 0; | 61 virtual void DidStartNavigation(Frame* frame) = 0; |
| 62 | 62 |
| 63 // Notification of various frame state changes. Generally only useful for | 63 // Notification of various frame state changes. Generally only useful for |
| 64 // tests. | 64 // tests. |
| 65 virtual void DidCreateFrame(Frame* frame); | 65 virtual void DidCreateFrame(Frame* frame); |
| 66 virtual void DidDestroyFrame(Frame* frame); | 66 virtual void DidDestroyFrame(Frame* frame); |
| 67 | 67 |
| 68 // Invoked when the View embedded in a Frame premuturely stops rendering | 68 // Invoked when the View embedded in a Frame premuturely stops rendering |
| 69 // to |frame|'s View. This could mean any of the following: | 69 // to |frame|'s View. This could mean any of the following: |
| 70 // . The app crashed. | 70 // . The app crashed. |
| 71 // . There is no app that renders the url. | 71 // . There is no app that renders the url. |
| 72 // . The app is still alive, but is shutting down. | 72 // . The app is still alive, but is shutting down. |
| 73 // Frame does nothing in response to this, but the delegate may wish to take | 73 // Frame does nothing in response to this, but the delegate may wish to take |
| 74 // action. | 74 // action. |
| 75 virtual void OnViewEmbeddedInFrameDisconnected(Frame* frame); | 75 virtual void OnViewEmbeddedInFrameDisconnected(Frame* frame); |
| 76 | 76 |
| 77 protected: | 77 protected: |
| 78 virtual ~FrameTreeDelegate() {} | 78 virtual ~FrameTreeDelegate() {} |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace web_view | 81 } // namespace web_view |
| 82 | 82 |
| 83 #endif // COMPONENTS_WEB_VIEW_FRAME_TREE_DELEGATE_H_ | 83 #endif // COMPONENTS_WEB_VIEW_FRAME_TREE_DELEGATE_H_ |
| OLD | NEW |