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

Unified Diff: components/sessions/core/session_service_commands.cc

Issue 1927203003: Add support for X11 workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted ui/views/widget/desktop_aura/x11_desktop_handler.cc Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/sessions/core/session_service_commands.cc
diff --git a/components/sessions/core/session_service_commands.cc b/components/sessions/core/session_service_commands.cc
index 5d3cbf4ddc3b6818b54c148e234c7aa56cb9ca68..91852f69a04fcc1c62cbe82f6c703f48b3fefbde 100644
--- a/components/sessions/core/session_service_commands.cc
+++ b/components/sessions/core/session_service_commands.cc
@@ -42,6 +42,7 @@ static const SessionCommand::id_type kCommandSetTabUserAgentOverride = 18;
static const SessionCommand::id_type kCommandSessionStorageAssociated = 19;
static const SessionCommand::id_type kCommandSetActiveWindow = 20;
static const SessionCommand::id_type kCommandLastActiveTime = 21;
+static const SessionCommand::id_type kCommandSetWindowWorkspace = 22;
namespace {
@@ -88,6 +89,8 @@ typedef IDAndIndexPayload WindowTypePayload;
typedef IDAndIndexPayload TabNavigationPathPrunedFromFrontPayload;
+typedef IDAndIndexPayload SetWindowWorkspacePayload;
+
struct PinnedStatePayload {
SessionID::id_type tab_id;
bool pinned_state;
@@ -580,6 +583,16 @@ bool CreateTabsAndWindows(const ScopedVector<SessionCommand>& data,
break;
}
+ case kCommandSetWindowWorkspace: {
+ SetWindowWorkspacePayload payload;
+ if(!command->GetPayload(&payload, sizeof(payload))) {
sky 2016/04/29 17:05:45 nit: space between 'if' and '('.
Tom (Use chromium acct) 2016/04/29 19:14:03 Done.
+ DVLOG(1) << "Failed reading command " << command->id();
+ return true;
+ }
+ GetWindow(payload.id, windows)->workspace_id = payload.index;
+ break;
+ }
+
default:
// TODO(skuhne): This might call back into a callback handler to extend
// the command set for specific implementations.
@@ -739,6 +752,18 @@ std::unique_ptr<SessionCommand> CreateLastActiveTimeCommand(
return command;
}
+std::unique_ptr<SessionCommand> CreateSetWindowWorkspaceCommand(
+ const SessionID& window_id,
+ int current_desktop) {
+ SetWindowWorkspacePayload payload = {0};
+ payload.id = window_id.id();
+ payload.index = current_desktop;
+ std::unique_ptr<SessionCommand> command(
+ new SessionCommand(kCommandSetWindowWorkspace, sizeof(payload)));
+ memcpy(command->contents(), &payload, sizeof(payload));
+ return command;
+}
+
std::unique_ptr<SessionCommand> CreateTabNavigationPathPrunedFromBackCommand(
const SessionID& tab_id,
int count) {

Powered by Google App Engine
This is Rietveld 408576698