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