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_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ |
6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "components/sessions/core/session_id.h" | 12 #include "components/sessions/core/session_id.h" |
13 #include "components/sessions/core/sessions_export.h" | 13 #include "components/sessions/core/sessions_export.h" |
| 14 #include "ui/base/ui_base_types.h" |
| 15 #include "ui/gfx/geometry/rect.h" |
14 | 16 |
15 class GURL; | 17 class GURL; |
16 | 18 |
17 namespace base { | 19 namespace base { |
18 class CancelableTaskTracker; | 20 class CancelableTaskTracker; |
19 class SequencedWorkerPool; | 21 class SequencedWorkerPool; |
20 } | 22 } |
21 | 23 |
22 namespace sessions { | 24 namespace sessions { |
23 | 25 |
24 class LiveTab; | 26 class LiveTab; |
25 class LiveTabContext; | 27 class LiveTabContext; |
26 struct SessionWindow; | 28 struct SessionWindow; |
27 | 29 |
28 // Callback from TabRestoreServiceClient::GetLastSession. | 30 // Callback from TabRestoreServiceClient::GetLastSession. |
29 // The second parameter is the id of the window that was last active. | 31 // The second parameter is the id of the window that was last active. |
30 using GetLastSessionCallback = | 32 using GetLastSessionCallback = |
31 base::Callback<void(std::vector<std::unique_ptr<SessionWindow>>, | 33 base::Callback<void(std::vector<std::unique_ptr<SessionWindow>>, |
32 SessionID::id_type)>; | 34 SessionID::id_type)>; |
33 | 35 |
34 // A client interface that needs to be supplied to the tab restore service by | 36 // A client interface that needs to be supplied to the tab restore service by |
35 // the embedder. | 37 // the embedder. |
36 class SESSIONS_EXPORT TabRestoreServiceClient { | 38 class SESSIONS_EXPORT TabRestoreServiceClient { |
37 public: | 39 public: |
38 virtual ~TabRestoreServiceClient(); | 40 virtual ~TabRestoreServiceClient(); |
39 | 41 |
40 // Creates a LiveTabContext instance that is associated with |app_name|. May | 42 // Creates a LiveTabContext instance that is associated with |app_name|. May |
41 // return nullptr (e.g., if the embedder does not support LiveTabContext | 43 // return nullptr (e.g., if the embedder does not support LiveTabContext |
42 // functionality). | 44 // functionality). |
43 virtual LiveTabContext* CreateLiveTabContext(const std::string& app_name) = 0; | 45 virtual LiveTabContext* CreateLiveTabContext( |
| 46 const std::string& app_name, |
| 47 const gfx::Rect& bounds, |
| 48 ui::WindowShowState show_state, |
| 49 const std::string& workspace) = 0; |
44 | 50 |
45 // Returns the LiveTabContext instance that is associated with | 51 // Returns the LiveTabContext instance that is associated with |
46 // |tab|, or null if there is no such instance. | 52 // |tab|, or null if there is no such instance. |
47 virtual LiveTabContext* FindLiveTabContextForTab(const LiveTab* tab) = 0; | 53 virtual LiveTabContext* FindLiveTabContextForTab(const LiveTab* tab) = 0; |
48 | 54 |
49 // Returns the LiveTabContext instance that is associated with |desired_id|, | 55 // Returns the LiveTabContext instance that is associated with |desired_id|, |
50 // or null if there is no such instance. | 56 // or null if there is no such instance. |
51 virtual LiveTabContext* FindLiveTabContextWithID( | 57 virtual LiveTabContext* FindLiveTabContextWithID( |
52 SessionID::id_type desired_id) = 0; | 58 SessionID::id_type desired_id) = 0; |
53 | 59 |
(...skipping 25 matching lines...) Expand all Loading... |
79 base::CancelableTaskTracker* tracker) = 0; | 85 base::CancelableTaskTracker* tracker) = 0; |
80 | 86 |
81 // Called when a tab is restored. |url| is the URL that the tab is currently | 87 // Called when a tab is restored. |url| is the URL that the tab is currently |
82 // visiting. | 88 // visiting. |
83 virtual void OnTabRestored(const GURL& url); | 89 virtual void OnTabRestored(const GURL& url); |
84 }; | 90 }; |
85 | 91 |
86 } // namespace sessions | 92 } // namespace sessions |
87 | 93 |
88 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ | 94 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ |
OLD | NEW |