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 BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ | 5 #ifndef BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ |
6 #define BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ | 6 #define BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "blimp/net/blimp_message_receiver.h" | 10 #include "blimp/net/blimp_message_processor.h" |
11 #include "content/public/browser/web_contents_delegate.h" | 11 #include "content/public/browser/web_contents_delegate.h" |
12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 class WindowTreeHost; | 15 class WindowTreeHost; |
16 | 16 |
17 namespace client { | 17 namespace client { |
18 class DefaultCaptureClient; | 18 class DefaultCaptureClient; |
19 class WindowTreeClient; | 19 class WindowTreeClient; |
20 } // namespace client | 20 } // namespace client |
(...skipping 14 matching lines...) Expand all Loading... |
35 class BlimpMessage; | 35 class BlimpMessage; |
36 | 36 |
37 namespace engine { | 37 namespace engine { |
38 | 38 |
39 class BlimpBrowserContext; | 39 class BlimpBrowserContext; |
40 class BlimpFocusClient; | 40 class BlimpFocusClient; |
41 class BlimpScreen; | 41 class BlimpScreen; |
42 class BlimpUiContextFactory; | 42 class BlimpUiContextFactory; |
43 class BlimpWindowTreeHost; | 43 class BlimpWindowTreeHost; |
44 | 44 |
45 class BlimpEngineSession : public BlimpMessageReceiver, | 45 class BlimpEngineSession : public BlimpMessageProcessor, |
46 public content::WebContentsDelegate { | 46 public content::WebContentsDelegate { |
47 public: | 47 public: |
48 explicit BlimpEngineSession(scoped_ptr<BlimpBrowserContext> browser_context); | 48 explicit BlimpEngineSession(scoped_ptr<BlimpBrowserContext> browser_context); |
49 ~BlimpEngineSession() override; | 49 ~BlimpEngineSession() override; |
50 | 50 |
51 void Initialize(); | 51 void Initialize(); |
52 | 52 |
53 BlimpBrowserContext* browser_context() { return browser_context_.get(); } | 53 BlimpBrowserContext* browser_context() { return browser_context_.get(); } |
54 | 54 |
55 void AttachClientConnection(scoped_ptr<BlimpConnection> client_connection); | 55 void AttachClientConnection(scoped_ptr<BlimpConnection> client_connection); |
56 | 56 |
57 private: | 57 private: |
58 // Creates a new WebContents, which will be indexed by |target_tab_id|. | 58 // Creates a new WebContents, which will be indexed by |target_tab_id|. |
59 void CreateWebContents(const int target_tab_id); | 59 void CreateWebContents(const int target_tab_id); |
60 | 60 |
61 // Navigates the target tab to the |url|. | 61 // Navigates the target tab to the |url|. |
62 void LoadUrl(const int target_tab_id, const GURL& url); | 62 void LoadUrl(const int target_tab_id, const GURL& url); |
63 | 63 |
64 // BlimpMessageReceiver implementation. | 64 // BlimpMessageProcessor implementation. |
65 net::Error OnBlimpMessage(const BlimpMessage& message) override; | 65 void ProcessMessage(const BlimpMessage& message, |
| 66 const net::CompletionCallback& callback) override; |
66 | 67 |
67 // content::WebContentsDelegate implementation. | 68 // content::WebContentsDelegate implementation. |
68 content::WebContents* OpenURLFromTab( | 69 content::WebContents* OpenURLFromTab( |
69 content::WebContents* source, | 70 content::WebContents* source, |
70 const content::OpenURLParams& params) override; | 71 const content::OpenURLParams& params) override; |
71 void AddNewContents(content::WebContents* source, | 72 void AddNewContents(content::WebContents* source, |
72 content::WebContents* new_contents, | 73 content::WebContents* new_contents, |
73 WindowOpenDisposition disposition, | 74 WindowOpenDisposition disposition, |
74 const gfx::Rect& initial_rect, | 75 const gfx::Rect& initial_rect, |
75 bool user_gesture, | 76 bool user_gesture, |
(...skipping 30 matching lines...) Expand all Loading... |
106 // Currently attached client connection. | 107 // Currently attached client connection. |
107 scoped_ptr<BlimpConnection> client_connection_; | 108 scoped_ptr<BlimpConnection> client_connection_; |
108 | 109 |
109 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); | 110 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
110 }; | 111 }; |
111 | 112 |
112 } // namespace engine | 113 } // namespace engine |
113 } // namespace blimp | 114 } // namespace blimp |
114 | 115 |
115 #endif // BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ | 116 #endif // BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ |
OLD | NEW |