Index: chrome/browser/sessions/session_backend_android.cc |
diff --git a/chrome/browser/sessions/session_backend_android.cc b/chrome/browser/sessions/session_backend_android.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..04ec15e3516e33205f8f40cf44f999e3bc988551 |
--- /dev/null |
+++ b/chrome/browser/sessions/session_backend_android.cc |
@@ -0,0 +1,71 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
joth
2012/07/31 17:34:27
2012
felipeg
2012/08/01 16:14:43
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/sessions/session_backend.h" |
+ |
+#include "base/stl_util.h" |
+#include "net/base/file_stream.h" |
+ |
+// TODO(joth): This is dirty hack to stop SessionBackend from touching the |
+// filesystem on Android as tab and session persistence is handled Java side. |
+// A better design would be to factor out just those bits of TabRestoreService |
+// that are required and not instantiate BaseSessionService or SessionBackend |
+// at all. |
+ |
+// static |
+const int SessionBackend::kFileReadBufferSize = 1024; |
+ |
+SessionBackend::SessionBackend(BaseSessionService::SessionType type, |
+ const FilePath& path_to_dir) |
+ : type_(type), |
+ path_to_dir_(path_to_dir) { |
+} |
+ |
+void SessionBackend::Init() { |
+} |
+ |
+void SessionBackend::AppendCommands(std::vector<SessionCommand*>* commands, |
+ bool reset_first) { |
+ STLDeleteElements(commands); |
+ delete commands; |
+} |
+ |
+void SessionBackend::ReadLastSessionCommands( |
+ scoped_refptr<BaseSessionService::InternalGetCommandsRequest> request) { |
+ if (request->canceled()) |
+ return; |
+ Init(); |
+ ReadLastSessionCommandsImpl(&(request->commands)); |
+ request->ForwardResult(request->handle(), request); |
+} |
+ |
+bool SessionBackend::ReadLastSessionCommandsImpl( |
+ std::vector<SessionCommand*>* commands) { |
+ commands->clear(); |
+ return false; |
+} |
+ |
+void SessionBackend::DeleteLastSession() { |
+} |
+ |
+void SessionBackend::MoveCurrentSessionToLastSession() { |
+} |
+ |
+void SessionBackend::ReadCurrentSessionCommands( |
+ scoped_refptr<BaseSessionService::InternalGetCommandsRequest> request) { |
+ if (request->canceled()) |
+ return; |
+ Init(); |
+ ReadCurrentSessionCommandsImpl(&(request->commands)); |
+ request->ForwardResult(request->handle(), request); |
+} |
+ |
+bool SessionBackend::ReadCurrentSessionCommandsImpl( |
+ std::vector<SessionCommand*>* commands) { |
+ commands->clear(); |
+ return false; |
+} |
+ |
+SessionBackend::~SessionBackend() { |
+} |