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