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

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: Removed GetSavedWindowWorkspace, put command line code into browser_frame.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
« no previous file with comments | « components/sessions/core/session_service_commands.h ('k') | components/sessions/core/session_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ca02f49e881f7e068ee42901490e71e9a14fd882 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 {
@@ -580,6 +581,21 @@ bool CreateTabsAndWindows(const ScopedVector<SessionCommand>& data,
break;
}
+ case kCommandSetWindowWorkspace: {
+ std::unique_ptr<base::Pickle> pickle(command->PayloadAsPickle());
+ base::PickleIterator it(*pickle);
+ const SessionID::id_type* window_id;
+ std::string workspace;
+ if (!it.ReadBytes(reinterpret_cast<const char**>(&window_id),
sky 2016/05/06 17:43:09 Why do you reinterpret cast here? You should be ab
Tom (Use chromium acct) 2016/05/06 18:25:40 Done.
+ sizeof(*window_id)) ||
+ !it.ReadString(&workspace)) {
+ DVLOG(1) << "Failed reading command " << command->id();
+ return true;
+ }
+ GetWindow(*window_id, windows)->workspace = workspace;
+ break;
+ }
+
default:
// TODO(skuhne): This might call back into a callback handler to extend
// the command set for specific implementations.
@@ -739,6 +755,18 @@ std::unique_ptr<SessionCommand> CreateLastActiveTimeCommand(
return command;
}
+std::unique_ptr<SessionCommand> CreateSetWindowWorkspaceCommand(
+ const SessionID& window_id,
+ const std::string& workspace) {
+ base::Pickle pickle;
+ pickle.WriteBytes(static_cast<const void*>(&window_id), sizeof(window_id));
sky 2016/05/06 17:43:09 Same comment here. Use WriteInt.
Tom (Use chromium acct) 2016/05/06 18:25:40 Done.
+ pickle.WriteString(workspace);
+ std::unique_ptr<SessionCommand> command(
+ new SessionCommand(kCommandSetWindowWorkspace, pickle.size()));
sky 2016/05/06 17:43:09 Use the constructor that takes the pickle.
Tom (Use chromium acct) 2016/05/06 18:25:40 Done.
+ memcpy(command->contents(), pickle.data(), pickle.size());
+ return command;
+}
+
std::unique_ptr<SessionCommand> CreateTabNavigationPathPrunedFromBackCommand(
const SessionID& tab_id,
int count) {
« no previous file with comments | « components/sessions/core/session_service_commands.h ('k') | components/sessions/core/session_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698