anchor.diff:          return new Future.error(
               '${header.first.substring(header.first.indexOf(' ') + 1)}: $body');
         } else {
  -        httpRequest = _getLaunchRequest(appContainer.project.name);
  -        return device.sendHttpRequest(httpRequest, 2424).timeout(
  -            new Duration(minutes: 5), onTimeout: () {
  -              canceled = true;
  -              return new Future.error(
  -                  'Push timed out: Total time exceeds 5 minutes');
  -            });
  -
  -      }
  -    }).then((_) {
  -      return device.sendHttpRequest(httpRequest, 2424).timeout(
  -          new Duration(minutes: 5), onTimeout: () {
  -            return new Future.error(
  -                'Push timed out: Total time exceeds 5 minutes');
  -          });
  -    }).catchError((_) {
  -      canceled = true;
  +        return body;
  +      }
       }).whenComplete(() {
  -      device.dispose();
  +      if (_device != null) _device.dispose();
       });
     }
   }
  -
  -class _DeployTarget {
  -  AndroidDevice device;
  -  TcpClient client;
  -
  -  Future sendRequest(List<int> httpRequest, [String target]) {
  -    if (device != null) {
  -      return device.sendHttpRequest(httpRequest, 2424).timeout(
  -          new Duration(minutes: 5), onTimeout: () {
  -            return new Future.error(
  -                'Push timed out: Total time exceeds 5 minutes');
  -          });
  -    } else {
  -        client.write(httpRequest);
  -        return client.stream.timeout(new Duration(minutes: 1)).first;
  -    }
  -  }
  -}
  
positive.code:     });
    }
  
    List<int> _buildHttpRequest(String target, List<int> payload) {
      List<int> httpRequest = [];
      // Build the HTTP request headers.
      String header =
          'POST /zippush?appId=${appContainer.project.name}&appType=chrome HTTP/1.1\r\n'
          'User-Agent: Spark IDE\r\n'
          'Host: ${target}:2424\r\n';
      List<int> body = [];
  
      // Add the CRX headers before the zip content.
      // This is the string "Cr24" then three little-endian 32-bit numbers:
      // - The version (2).
      // - The public key length (0).
      // - The signature length (0).
      // Since the App Dev Tool on the other end doesn't check
      // the signature or key, we don't bother sending them.
  
      // Now follows the actual zip data.
      body.addAll(payload);
      httpRequest.addAll(header.codeUnits);
      httpRequest.addAll('Content-length: ${body.length}\r\n\r\n'.codeUnits);
      httpRequest.addAll(body);
  
      return httpRequest;
    }
  
    Future _sendHttpPush(String target, ProgressMonitor monitor) {
      List<int> httpRequest;
      return archiveContainer(appContainer, true).then((List<int> archivedData) {
        monitor.worked(3);
        httpRequest = _buildHttpRequest(target, archivedData);
        monitor.worked(5);
        return _sendRequest(httpRequest, target);
      }).then((List<int> responseBytes) {
        String response = new String.fromCharCodes(responseBytes);
        List<String> lines = response.split('\n');
  
negative.code: 
    Future _pushViaUSB(ProgressMonitor monitor) {
      List<int> httpRequest;
      AndroidDevice _device;
  
      // Build the archive.
      return archiveContainer(appContainer, true).then((List<int> archivedData) {
        monitor.worked(3);
        httpRequest = _buildHttpRequest('localhost', archivedData);
        monitor.worked(4);
  
        // Send this payload to the USB code.
        return _fetchAndroidDevice();
      }).then((deviceResult) {
        _device = deviceResult;
  
        return _device.sendHttpRequest(httpRequest, 2424).timeout(
            new Duration(minutes: 5), onTimeout: () {
              return new Future.error(
                  'Push timed out: Total time exceeds 5 minutes');
            });
      }).then((msg) {
        monitor.worked(3);
        String resp = new String.fromCharCodes(msg);
        List<String> lines = resp.split('\r\n');
  