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

Side by Side Diff: chrome/browser/sessions/session_service.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, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sessions/session_service.h" 5 #include "chrome/browser/sessions/session_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void SessionService::SetWindowBounds(const SessionID& window_id, 162 void SessionService::SetWindowBounds(const SessionID& window_id,
163 const gfx::Rect& bounds, 163 const gfx::Rect& bounds,
164 ui::WindowShowState show_state) { 164 ui::WindowShowState show_state) {
165 if (!ShouldTrackChangesToWindow(window_id)) 165 if (!ShouldTrackChangesToWindow(window_id))
166 return; 166 return;
167 167
168 ScheduleCommand( 168 ScheduleCommand(
169 sessions::CreateSetWindowBoundsCommand(window_id, bounds, show_state)); 169 sessions::CreateSetWindowBoundsCommand(window_id, bounds, show_state));
170 } 170 }
171 171
172 void SessionService::SetWindowWorkspace(const SessionID& window_id,
173 const std::string& workspace) {
174 if (!ShouldTrackChangesToWindow(window_id))
175 return;
176
177 ScheduleCommand(
178 sessions::CreateSetWindowWorkspaceCommand(window_id, workspace));
179 }
180
172 void SessionService::SetTabIndexInWindow(const SessionID& window_id, 181 void SessionService::SetTabIndexInWindow(const SessionID& window_id,
173 const SessionID& tab_id, 182 const SessionID& tab_id,
174 int new_index) { 183 int new_index) {
175 if (!ShouldTrackChangesToWindow(window_id)) 184 if (!ShouldTrackChangesToWindow(window_id))
176 return; 185 return;
177 186
178 ScheduleCommand( 187 ScheduleCommand(
179 sessions::CreateSetTabIndexInWindowCommand(tab_id, new_index)); 188 sessions::CreateSetTabIndexInWindowCommand(tab_id, new_index));
180 } 189 }
181 190
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 browser->session_id(), 817 browser->session_id(),
809 WindowTypeForBrowserType(browser->type()))); 818 WindowTypeForBrowserType(browser->type())));
810 819
811 if (!browser->app_name().empty()) { 820 if (!browser->app_name().empty()) {
812 base_session_service_->AppendRebuildCommand( 821 base_session_service_->AppendRebuildCommand(
813 sessions::CreateSetWindowAppNameCommand( 822 sessions::CreateSetWindowAppNameCommand(
814 browser->session_id(), 823 browser->session_id(),
815 browser->app_name())); 824 browser->app_name()));
816 } 825 }
817 826
827 sessions::CreateSetWindowWorkspaceCommand(
828 browser->session_id(), browser->window()->GetWorkspace());
829
818 windows_to_track->insert(browser->session_id().id()); 830 windows_to_track->insert(browser->session_id().id());
819 TabStripModel* tab_strip = browser->tab_strip_model(); 831 TabStripModel* tab_strip = browser->tab_strip_model();
820 for (int i = 0; i < tab_strip->count(); ++i) { 832 for (int i = 0; i < tab_strip->count(); ++i) {
821 WebContents* tab = tab_strip->GetWebContentsAt(i); 833 WebContents* tab = tab_strip->GetWebContentsAt(i);
822 DCHECK(tab); 834 DCHECK(tab);
823 BuildCommandsForTab(browser->session_id(), 835 BuildCommandsForTab(browser->session_id(),
824 tab, 836 tab,
825 i, 837 i,
826 tab_strip->IsTabPinned(i), 838 tab_strip->IsTabPinned(i),
827 tab_to_available_range); 839 tab_to_available_range);
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 for (auto* browser : *BrowserList::GetInstance()) { 1096 for (auto* browser : *BrowserList::GetInstance()) {
1085 if (browser->profile() == profile()) 1097 if (browser->profile() == profile())
1086 return; 1098 return;
1087 } 1099 }
1088 DeleteSessionOnlyData(profile()); 1100 DeleteSessionOnlyData(profile());
1089 } 1101 }
1090 1102
1091 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() { 1103 sessions::BaseSessionService* SessionService::GetBaseSessionServiceForTest() {
1092 return base_session_service_.get(); 1104 return base_session_service_.get();
1093 } 1105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698