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_receiver.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // BlimpMessageReceiver implementation. | 55 // BlimpMessageReceiver implementation. |
56 // TODO(haibinlu): Remove this in favor of the BlimpMessageDispatcher. | 56 // TODO(haibinlu): Remove this in favor of the BlimpMessageDispatcher. |
57 net::Error OnBlimpMessage(const BlimpMessage& message) override; | 57 net::Error OnBlimpMessage(const BlimpMessage& message) override; |
58 | 58 |
59 private: | 59 private: |
| 60 // ControlMessage handler methods. |
60 // Creates a new WebContents, which will be indexed by |target_tab_id|. | 61 // Creates a new WebContents, which will be indexed by |target_tab_id|. |
61 void CreateWebContents(const int target_tab_id); | 62 void CreateWebContents(const int target_tab_id); |
| 63 void CloseWebContents(const int target_tab_id); |
62 | 64 |
| 65 // NavigationMessage handler methods. |
63 // Navigates the target tab to the |url|. | 66 // Navigates the target tab to the |url|. |
64 void LoadUrl(const int target_tab_id, const GURL& url); | 67 void LoadUrl(const int target_tab_id, const GURL& url); |
| 68 void GoBack(const int target_tab_id); |
| 69 void GoForward(const int target_tab_id); |
| 70 void Reload(const int target_tab_id); |
65 | 71 |
66 // content::WebContentsDelegate implementation. | 72 // content::WebContentsDelegate implementation. |
67 content::WebContents* OpenURLFromTab( | 73 content::WebContents* OpenURLFromTab( |
68 content::WebContents* source, | 74 content::WebContents* source, |
69 const content::OpenURLParams& params) override; | 75 const content::OpenURLParams& params) override; |
70 void AddNewContents(content::WebContents* source, | 76 void AddNewContents(content::WebContents* source, |
71 content::WebContents* new_contents, | 77 content::WebContents* new_contents, |
72 WindowOpenDisposition disposition, | 78 WindowOpenDisposition disposition, |
73 const gfx::Rect& initial_rect, | 79 const gfx::Rect& initial_rect, |
74 bool user_gesture, | 80 bool user_gesture, |
(...skipping 30 matching lines...) Expand all Loading... |
105 // Currently attached client connection. | 111 // Currently attached client connection. |
106 scoped_ptr<BlimpConnection> client_connection_; | 112 scoped_ptr<BlimpConnection> client_connection_; |
107 | 113 |
108 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); | 114 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
109 }; | 115 }; |
110 | 116 |
111 } // namespace engine | 117 } // namespace engine |
112 } // namespace blimp | 118 } // namespace blimp |
113 | 119 |
114 #endif // BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ | 120 #endif // BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_ |
OLD | NEW |