OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_COMMANDS_H_ | |
6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_COMMANDS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "components/sessions/session_id.h" | |
11 | |
12 class SessionCommand; | |
13 | |
14 namespace sessions { | |
15 class SerializedNavigationEntry; | |
16 } | |
17 | |
18 // These commands create and read common base commands for SessionService and | |
19 // PersistentTabRestoreService. | |
20 | |
sky
2014/10/28 22:52:38
Add a TODO to convert to returning scoped_ptr and
Mr4D (OOO till 08-26)
2014/10/29 02:04:13
Done.
| |
21 // Creates a SessionCommand that represents a navigation. | |
22 SessionCommand* CreateUpdateTabNavigationCommand( | |
23 SessionID::id_type command_id, | |
24 SessionID::id_type tab_id, | |
25 const sessions::SerializedNavigationEntry& navigation); | |
26 | |
27 // Creates a SessionCommand that represents marking a tab as an application. | |
28 SessionCommand* CreateSetTabExtensionAppIDCommand( | |
29 SessionID::id_type command_id, | |
30 SessionID::id_type tab_id, | |
31 const std::string& extension_id); | |
32 | |
33 // Creates a SessionCommand that containing user agent override used by a | |
34 // tab's navigations. | |
35 SessionCommand* CreateSetTabUserAgentOverrideCommand( | |
36 SessionID::id_type command_id, | |
37 SessionID::id_type tab_id, | |
38 const std::string& user_agent_override); | |
39 | |
40 // Creates a SessionCommand stores a browser window's app name. | |
41 SessionCommand* CreateSetWindowAppNameCommand(SessionID::id_type command_id, | |
42 SessionID::id_type window_id, | |
43 const std::string& app_name); | |
44 | |
45 // Converts a SessionCommand previously created by | |
46 // CreateUpdateTabNavigationCommand into a | |
47 // sessions::SerializedNavigationEntry. Returns true on success. If | |
48 // successful |tab_id| is set to the id of the restored tab. | |
49 bool RestoreUpdateTabNavigationCommand( | |
50 const SessionCommand& command, | |
51 sessions::SerializedNavigationEntry* navigation, | |
52 SessionID::id_type* tab_id); | |
53 | |
54 // Extracts a SessionCommand as previously created by | |
55 // CreateSetTabExtensionAppIDCommand into the tab id and application | |
56 // extension id. | |
57 bool RestoreSetTabExtensionAppIDCommand(const SessionCommand& command, | |
58 SessionID::id_type* tab_id, | |
59 std::string* extension_app_id); | |
60 | |
61 // Extracts a SessionCommand as previously created by | |
62 // CreateSetTabUserAgentOverrideCommand into the tab id and user agent. | |
63 bool RestoreSetTabUserAgentOverrideCommand(const SessionCommand& command, | |
64 SessionID::id_type* tab_id, | |
65 std::string* user_agent_override); | |
66 | |
67 // Extracts a SessionCommand as previously created by | |
68 // CreateSetWindowAppNameCommand into the window id and application name. | |
69 bool RestoreSetWindowAppNameCommand(const SessionCommand& command, | |
70 SessionID::id_type* window_id, | |
71 std::string* app_name); | |
72 | |
73 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_COMMANDS_H_ | |
OLD | NEW |