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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/browser.py

Issue 10965027: Add web page replay to chrome_remote_control. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace CreateForwarder with CreateReplayServer Created 8 years, 2 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: tools/chrome_remote_control/chrome_remote_control/browser.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/browser.py b/tools/chrome_remote_control/chrome_remote_control/browser.py
index e90bf9eaf8ce39e060d0157e29f937751684b09f..334853301e2e2758475053942fb45c44ba46288b 100644
--- a/tools/chrome_remote_control/chrome_remote_control/browser.py
+++ b/tools/chrome_remote_control/chrome_remote_control/browser.py
@@ -1,6 +1,9 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
+
+from chrome_remote_control import replay_server
from chrome_remote_control import temporary_http_server
class Browser(object):
@@ -43,3 +46,13 @@ class Browser(object):
def CreateTemporaryHTTPServer(self, path):
return temporary_http_server.TemporaryHTTPServer(self._backend, path)
+
+ @classmethod
+ def CanUseReplayServer(cls, archive_path, use_record_mode):
+ return os.path.isfile(archive_path) or use_record_mode
+
+ def CreateReplayServer(self, archive_path, use_record_mode):
+ replay_class = replay_server.DoNothingReplayServer
+ if self.CanUseReplayServer(archive_path, use_record_mode):
+ replay_class = replay_server.ReplayServer
+ return replay_class(self._backend, archive_path, use_record_mode)

Powered by Google App Engine
This is Rietveld 408576698