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_CONNECTION_H_ | 5 #ifndef MANDOLINE_TAB_FRAME_CONNECTION_H_ |
6 #define MANDOLINE_TAB_FRAME_CONNECTION_H_ | 6 #define MANDOLINE_TAB_FRAME_CONNECTION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "components/view_manager/public/interfaces/view_manager.mojom.h" | 10 #include "components/view_manager/public/interfaces/view_tree.mojom.h" |
11 #include "mandoline/tab/frame_user_data.h" | 11 #include "mandoline/tab/frame_user_data.h" |
12 #include "mandoline/tab/public/interfaces/frame_tree.mojom.h" | 12 #include "mandoline/tab/public/interfaces/frame_tree.mojom.h" |
13 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 13 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 class ApplicationConnection; | 16 class ApplicationConnection; |
17 class ApplicationImpl; | 17 class ApplicationImpl; |
18 } | 18 } |
19 | 19 |
20 namespace mandoline { | 20 namespace mandoline { |
21 | 21 |
22 // FrameConnection is a FrameUserData that manages the connection to a | 22 // FrameConnection is a FrameUserData that manages the connection to a |
23 // particular frame. It is also responsible for obtaining the necessary | 23 // particular frame. It is also responsible for obtaining the necessary |
24 // services from the remote side. | 24 // services from the remote side. |
25 class FrameConnection : public FrameUserData { | 25 class FrameConnection : public FrameUserData { |
26 public: | 26 public: |
27 FrameConnection(); | 27 FrameConnection(); |
28 ~FrameConnection() override; | 28 ~FrameConnection() override; |
29 | 29 |
30 void Init(mojo::ApplicationImpl* app, | 30 void Init(mojo::ApplicationImpl* app, |
31 mojo::URLRequestPtr request, | 31 mojo::URLRequestPtr request, |
32 mojo::ViewManagerClientPtr* view_manage_client); | 32 mojo::ViewTreeClientPtr* view_tree_client); |
33 | 33 |
34 FrameTreeClient* frame_tree_client() { return frame_tree_client_.get(); } | 34 FrameTreeClient* frame_tree_client() { return frame_tree_client_.get(); } |
35 | 35 |
36 mojo::ApplicationConnection* application_connection() { | 36 mojo::ApplicationConnection* application_connection() { |
37 return application_connection_.get(); | 37 return application_connection_.get(); |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
41 FrameTreeClientPtr frame_tree_client_; | 41 FrameTreeClientPtr frame_tree_client_; |
42 | 42 |
43 // TODO(sky): needs to be destroyed when connection lost. | 43 // TODO(sky): needs to be destroyed when connection lost. |
44 scoped_ptr<mojo::ApplicationConnection> application_connection_; | 44 scoped_ptr<mojo::ApplicationConnection> application_connection_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(FrameConnection); | 46 DISALLOW_COPY_AND_ASSIGN(FrameConnection); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace mandoline | 49 } // namespace mandoline |
50 | 50 |
51 #endif // MANDOLINE_TAB_FRAME_CONNECTION_H_ | 51 #endif // MANDOLINE_TAB_FRAME_CONNECTION_H_ |
OLD | NEW |