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

Unified Diff: chrome/browser/sessions/base_session_service.cc

Issue 9359022: Aura: Support hovering restore & close buttons for full screen apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added new test for tab restore Created 8 years, 10 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: chrome/browser/sessions/base_session_service.cc
diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc
index a529d31c4026a4d8c830d3e699cbcd2ae52f8064..89c307ffe53daca110802e9630023afd61f8b219 100644
--- a/chrome/browser/sessions/base_session_service.cc
+++ b/chrome/browser/sessions/base_session_service.cc
@@ -247,6 +247,25 @@ SessionCommand* BaseSessionService::CreateSetTabExtensionAppIDCommand(
return new SessionCommand(command_id, pickle);
}
+SessionCommand* BaseSessionService::CreateSetWindowAppNameCommand(
+ SessionID::id_type command_id,
+ SessionID::id_type window_id,
+ const std::string& app_name) {
+ // Use pickle to handle marshalling.
+ Pickle pickle;
+ pickle.WriteInt(window_id);
+
+ // Enforce a max for ids. They should never be anywhere near this size.
+ static const SessionCommand::size_type max_id_size =
+ std::numeric_limits<SessionCommand::size_type>::max() - 1024;
+
+ int bytes_written = 0;
+
+ WriteStringToPickle(pickle, &bytes_written, max_id_size, app_name);
+
+ return new SessionCommand(command_id, pickle);
+}
+
bool BaseSessionService::RestoreUpdateTabNavigationCommand(
const SessionCommand& command,
TabNavigation* navigation,
@@ -311,6 +330,19 @@ bool BaseSessionService::RestoreSetTabExtensionAppIDCommand(
pickle->ReadString(&iterator, extension_app_id);
}
+bool BaseSessionService::RestoreSetWindowAppNameCommand(
+ const SessionCommand& command,
+ SessionID::id_type* window_id,
+ std::string* app_name) {
+ scoped_ptr<Pickle> pickle(command.PayloadAsPickle());
+ if (!pickle.get())
+ return false;
+
+ void* iterator = NULL;
+ return pickle->ReadInt(&iterator, window_id) &&
+ pickle->ReadString(&iterator, app_name);
+}
+
bool BaseSessionService::ShouldTrackEntry(const GURL& url) {
// NOTE: Do not track print preview tab because re-opening that page will
// just display a non-functional print preview page.

Powered by Google App Engine
This is Rietveld 408576698