OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_SESSION_SERVICE_COMMANDS_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_SESSION_SERVICE_COMMANDS_H_ |
6 #define COMPONENTS_SESSIONS_CORE_SESSION_SERVICE_COMMANDS_H_ | 6 #define COMPONENTS_SESSIONS_CORE_SESSION_SERVICE_COMMANDS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SESSIONS_EXPORT std::unique_ptr<SessionCommand> | 69 SESSIONS_EXPORT std::unique_ptr<SessionCommand> |
70 CreateSetTabUserAgentOverrideCommand(const SessionID& tab_id, | 70 CreateSetTabUserAgentOverrideCommand(const SessionID& tab_id, |
71 const std::string& user_agent_override); | 71 const std::string& user_agent_override); |
72 SESSIONS_EXPORT std::unique_ptr<SessionCommand> CreateSetWindowAppNameCommand( | 72 SESSIONS_EXPORT std::unique_ptr<SessionCommand> CreateSetWindowAppNameCommand( |
73 const SessionID& window_id, | 73 const SessionID& window_id, |
74 const std::string& app_name); | 74 const std::string& app_name); |
75 SESSIONS_EXPORT std::unique_ptr<SessionCommand> CreateLastActiveTimeCommand( | 75 SESSIONS_EXPORT std::unique_ptr<SessionCommand> CreateLastActiveTimeCommand( |
76 const SessionID& tab_id, | 76 const SessionID& tab_id, |
77 base::TimeTicks last_active_time); | 77 base::TimeTicks last_active_time); |
78 | 78 |
| 79 SESSIONS_EXPORT std::unique_ptr<SessionCommand> CreateSetWindowWorkspaceCommand( |
| 80 const SessionID& window_id, |
| 81 int workspace_id); |
| 82 |
79 // Searches for a pending command using |base_session_service| that can be | 83 // Searches for a pending command using |base_session_service| that can be |
80 // replaced with |command|. If one is found, pending command is removed, the | 84 // replaced with |command|. If one is found, pending command is removed, the |
81 // command is added to the pending commands (taken ownership) and true is | 85 // command is added to the pending commands (taken ownership) and true is |
82 // returned. | 86 // returned. |
83 SESSIONS_EXPORT bool ReplacePendingCommand( | 87 SESSIONS_EXPORT bool ReplacePendingCommand( |
84 BaseSessionService* base_session_service, | 88 BaseSessionService* base_session_service, |
85 std::unique_ptr<SessionCommand>* command); | 89 std::unique_ptr<SessionCommand>* command); |
86 | 90 |
87 // Returns true if provided |command| either closes a window or a tab. | 91 // Returns true if provided |command| either closes a window or a tab. |
88 SESSIONS_EXPORT bool IsClosingCommand(SessionCommand* command); | 92 SESSIONS_EXPORT bool IsClosingCommand(SessionCommand* command); |
89 | 93 |
90 // Converts a list of commands into SessionWindows. On return any valid | 94 // Converts a list of commands into SessionWindows. On return any valid |
91 // windows are added to valid_windows. It is up to the caller to delete | 95 // windows are added to valid_windows. It is up to the caller to delete |
92 // the windows added to valid_windows. |active_window_id| will be set with the | 96 // the windows added to valid_windows. |active_window_id| will be set with the |
93 // id of the last active window, but it's only valid when this id corresponds | 97 // id of the last active window, but it's only valid when this id corresponds |
94 // to the id of one of the windows in valid_windows. | 98 // to the id of one of the windows in valid_windows. |
95 SESSIONS_EXPORT void RestoreSessionFromCommands( | 99 SESSIONS_EXPORT void RestoreSessionFromCommands( |
96 const ScopedVector<SessionCommand>& commands, | 100 const ScopedVector<SessionCommand>& commands, |
97 std::vector<SessionWindow*>* valid_windows, | 101 std::vector<SessionWindow*>* valid_windows, |
98 SessionID::id_type* active_window_id); | 102 SessionID::id_type* active_window_id); |
99 | 103 |
100 } // namespace sessions | 104 } // namespace sessions |
101 | 105 |
102 #endif // COMPONENTS_SESSIONS_CORE_SESSION_SERVICE_COMMANDS_H_ | 106 #endif // COMPONENTS_SESSIONS_CORE_SESSION_SERVICE_COMMANDS_H_ |
OLD | NEW |