Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package


// Copyright (c) 2010 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.

// Support utilities for the JSON automation interface used by PyAuto.


#include <string>

#include "base/values.h"
#include "ipc/ipc_message.h"
#include "chrome/browser/automation/automation_provider.h"

// Helper to ensure we always send a reply message for JSON automation requests.
class AutomationJSONReply {
  // Creates a new reply object for the IPC message |reply_message| for
  // |provider|. The caller is expected to call SendSuccess() or SendError()
  // before destroying this object.
  AutomationJSONReply(AutomationProvider* provider,
                      IPC::Message* reply_message);


  // Send a success reply along with data contained in |value|.
  // An empty message will be sent if |value| is NULL.
  void SendSuccess(const Value* value);

  // Send an error reply along with error message |error_message|.
  void SendError(const std::string& error_message);

  AutomationProvider* provider_;
  IPC::Message* message_;


Generated by  Doxygen 1.6.0   Back to index