buffet: Remove DBusManager class

Move the TestMethod to the Manager, then remove the DBusManager
entirely.  This lets us turn the object at org/chromium/Buffet
into a pure object manager and removes a lot of boilerplate.

BUG=chromium:359190
TEST=buffet_client continues to demonstrate buffet functionality
through the TestMethod, which is now implementated by the Manager.

Change-Id: Ie9ecf0f7dd4dd50a3355ad7b06b8e2cfca71d9f9
Reviewed-on: https://chromium-review.googlesource.com/198760
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/buffet/manager.cc b/buffet/manager.cc
index a6c8d9f..7e64223 100644
--- a/buffet/manager.cc
+++ b/buffet/manager.cc
@@ -6,13 +6,13 @@
 
 #include <base/bind.h>
 #include <base/bind_helpers.h>
+#include <base/json/json_writer.h>
+#include <dbus/bus.h>
 #include <dbus/object_path.h>
 #include <dbus/values_util.h>
-#include <base/json/json_writer.h>
 
 #include "buffet/async_event_sequencer.h"
 #include "buffet/dbus_constants.h"
-#include "buffet/dbus_manager.h"
 #include "buffet/dbus_utils.h"
 
 using buffet::dbus_utils::GetBadArgsError;
@@ -93,6 +93,14 @@
           dbus_constants::kManagerUpdateStateMethod,
           "Failed exporting UpdateState method",
           true));
+  exported_object_->ExportMethod(
+      dbus_constants::kManagerInterface, dbus_constants::kManagerTestMethod,
+      dbus_utils::GetExportableDBusMethod(
+          base::Bind(&Manager::HandleTestMethod, base::Unretained(this))),
+      sequencer->GetExportHandler(
+          dbus_constants::kManagerInterface, dbus_constants::kManagerTestMethod,
+          "Failed exporting TestMethod method",
+          true));
   properties_.reset(new Properties(bus_));
   // TODO(wiley): Initialize all properties appropriately before claiming
   //              the properties interface.
@@ -242,4 +250,10 @@
   return dbus::Response::FromMethodCall(method_call);
 }
 
+scoped_ptr<dbus::Response> Manager::HandleTestMethod(
+    dbus::MethodCall* method_call) {
+  LOG(INFO) << "Received call to test method.";
+  return scoped_ptr<dbus::Response>();
+}
+
 }  // namespace buffet