| 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 MANDOLINE_TAB_FRAME_TREE_DELEGATE_H_ | 5 #ifndef MANDOLINE_TAB_FRAME_TREE_DELEGATE_H_ |
| 6 #define MANDOLINE_TAB_FRAME_TREE_DELEGATE_H_ | 6 #define MANDOLINE_TAB_FRAME_TREE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "mandoline/tab/public/interfaces/frame_tree.mojom.h" | 8 #include "mandoline/tab/public/interfaces/frame_tree.mojom.h" |
| 9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| 10 | 10 |
| 11 namespace mandoline { | 11 namespace mandoline { |
| 12 | 12 |
| 13 class Frame; | 13 class Frame; |
| 14 class MessageEvent; | 14 class HTMLMessageEvent; |
| 15 | 15 |
| 16 class FrameTreeDelegate { | 16 class FrameTreeDelegate { |
| 17 public: | 17 public: |
| 18 // Returns whether a request to post a message from |source| to |target| |
| 19 // is allowed. |source| and |target| are never null. |
| 18 virtual bool CanPostMessageEventToFrame(const Frame* source, | 20 virtual bool CanPostMessageEventToFrame(const Frame* source, |
| 19 const Frame* target, | 21 const Frame* target, |
| 20 MessageEvent* event) = 0; | 22 HTMLMessageEvent* event) = 0; |
| 23 |
| 21 virtual void LoadingStateChanged(bool loading) = 0; | 24 virtual void LoadingStateChanged(bool loading) = 0; |
| 22 virtual void ProgressChanged(double progress) = 0; | 25 virtual void ProgressChanged(double progress) = 0; |
| 23 | 26 |
| 24 // |source| is requesting a navigation. If |target_type| is | 27 // |source| is requesting a navigation. If |target_type| is |
| 25 // |EXISTING_FRAME| then |target_frame| identifies the frame to perform the | 28 // |EXISTING_FRAME| then |target_frame| identifies the frame to perform the |
| 26 // navigation in, otherwise |target_frame| is not used. |target_frame| may | 29 // navigation in, otherwise |target_frame| is not used. |target_frame| may |
| 27 // be null, even for |EXISTING_FRAME|. | 30 // be null, even for |EXISTING_FRAME|. |
| 28 virtual void RequestNavigate(Frame* source, | 31 virtual void RequestNavigate(Frame* source, |
| 29 NavigationTargetType target_type, | 32 NavigationTargetType target_type, |
| 30 Frame* target_frame, | 33 Frame* target_frame, |
| 31 mojo::URLRequestPtr request) = 0; | 34 mojo::URLRequestPtr request) = 0; |
| 32 | 35 |
| 33 protected: | 36 protected: |
| 34 virtual ~FrameTreeDelegate() {} | 37 virtual ~FrameTreeDelegate() {} |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 } // namespace mandoline | 40 } // namespace mandoline |
| 38 | 41 |
| 39 #endif // MANDOLINE_TAB_FRAME_TREE_DELEGATE_H_ | 42 #endif // MANDOLINE_TAB_FRAME_TREE_DELEGATE_H_ |
| OLD | NEW |