Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: components/sessions/core/tab_restore_service_client.h

Issue 2868983003: Ensure History > Recent Tabs restore preserves window disposition. (Closed)
Patch Set: Minor cleanup. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
14 15
15 class GURL; 16 class GURL;
16 17
17 namespace base { 18 namespace base {
18 class CancelableTaskTracker; 19 class CancelableTaskTracker;
19 class SequencedWorkerPool; 20 class SequencedWorkerPool;
20 } 21 }
21 22
23 namespace gfx {
24 class Rect;
25 }
26
22 namespace sessions { 27 namespace sessions {
23 28
24 class LiveTab; 29 class LiveTab;
25 class LiveTabContext; 30 class LiveTabContext;
26 struct SessionWindow; 31 struct SessionWindow;
27 32
28 // Callback from TabRestoreServiceClient::GetLastSession. 33 // Callback from TabRestoreServiceClient::GetLastSession.
29 // The second parameter is the id of the window that was last active. 34 // The second parameter is the id of the window that was last active.
30 using GetLastSessionCallback = 35 using GetLastSessionCallback =
31 base::Callback<void(std::vector<std::unique_ptr<SessionWindow>>, 36 base::Callback<void(std::vector<std::unique_ptr<SessionWindow>>,
32 SessionID::id_type)>; 37 SessionID::id_type)>;
33 38
34 // A client interface that needs to be supplied to the tab restore service by 39 // A client interface that needs to be supplied to the tab restore service by
35 // the embedder. 40 // the embedder.
36 class SESSIONS_EXPORT TabRestoreServiceClient { 41 class SESSIONS_EXPORT TabRestoreServiceClient {
37 public: 42 public:
38 virtual ~TabRestoreServiceClient(); 43 virtual ~TabRestoreServiceClient();
39 44
40 // Creates a LiveTabContext instance that is associated with |app_name|. May 45 // Creates a LiveTabContext instance that is associated with |app_name|. May
41 // return nullptr (e.g., if the embedder does not support LiveTabContext 46 // return nullptr (e.g., if the embedder does not support LiveTabContext
42 // functionality). 47 // functionality).
43 virtual LiveTabContext* CreateLiveTabContext(const std::string& app_name) = 0; 48 virtual LiveTabContext* CreateLiveTabContext(
49 const std::string& app_name,
50 const gfx::Rect& bounds,
51 ui::WindowShowState show_state,
52 const std::string& workspace) = 0;
44 53
45 // Returns the LiveTabContext instance that is associated with 54 // Returns the LiveTabContext instance that is associated with
46 // |tab|, or null if there is no such instance. 55 // |tab|, or null if there is no such instance.
47 virtual LiveTabContext* FindLiveTabContextForTab(const LiveTab* tab) = 0; 56 virtual LiveTabContext* FindLiveTabContextForTab(const LiveTab* tab) = 0;
48 57
49 // Returns the LiveTabContext instance that is associated with |desired_id|, 58 // Returns the LiveTabContext instance that is associated with |desired_id|,
50 // or null if there is no such instance. 59 // or null if there is no such instance.
51 virtual LiveTabContext* FindLiveTabContextWithID( 60 virtual LiveTabContext* FindLiveTabContextWithID(
52 SessionID::id_type desired_id) = 0; 61 SessionID::id_type desired_id) = 0;
53 62
(...skipping 25 matching lines...) Expand all
79 base::CancelableTaskTracker* tracker) = 0; 88 base::CancelableTaskTracker* tracker) = 0;
80 89
81 // Called when a tab is restored. |url| is the URL that the tab is currently 90 // Called when a tab is restored. |url| is the URL that the tab is currently
82 // visiting. 91 // visiting.
83 virtual void OnTabRestored(const GURL& url); 92 virtual void OnTabRestored(const GURL& url);
84 }; 93 };
85 94
86 } // namespace sessions 95 } // namespace sessions
87 96
88 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_ 97 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698