For c++, Generate enum classes instead of enum from mojom.

Change the mojom c++ binding generator to produce C++11 style enum
classes instead of just enums.  Fixup generated code to be compatible
with this new (stricter) syntax.

Also, fixup existing code to be compatible with the new syntax
requirements

BUG=
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/1375313006 .
diff --git a/services/native_support/process_controller_impl.cc b/services/native_support/process_controller_impl.cc
index d4a9919..3f5f4ba 100644
--- a/services/native_support/process_controller_impl.cc
+++ b/services/native_support/process_controller_impl.cc
@@ -30,8 +30,8 @@
     const base::Callback<void(mojo::files::Error, int32_t)>& done_callback) {
   int exit_status = 0;
   mojo::files::Error result = process.WaitForExit(&exit_status)
-                                  ? mojo::files::ERROR_OK
-                                  : mojo::files::ERROR_UNKNOWN;
+                                  ? mojo::files::Error::OK
+                                  : mojo::files::Error::UNKNOWN;
   done_runner->PostTask(
       FROM_HERE,
       base::Bind(done_callback, result, static_cast<int32_t>(exit_status)));
@@ -67,7 +67,7 @@
 void ProcessControllerImpl::Wait(const WaitCallback& callback) {
   if (!process_.IsValid()) {
     // TODO(vtl): This isn't quite right.
-    callback.Run(mojo::files::ERROR_UNAVAILABLE, 0);
+    callback.Run(mojo::files::Error::UNAVAILABLE, 0);
     return;
   }
 
@@ -90,13 +90,13 @@
 
 mojo::files::Error ProcessControllerImpl::KillHelper(int32_t signal) {
   if (signal < 0)
-    return mojo::files::ERROR_INVALID_ARGUMENT;
+    return mojo::files::Error::INVALID_ARGUMENT;
 
   if (!process_.IsValid()) {
     LOG(ERROR) << "Kill() called after Wait()";
     // TODO(vtl): This error code isn't quite right, but "unavailable" (which
     // would also be wrong) is used for a more appropriate purpose below.
-    return mojo::files::ERROR_INVALID_ARGUMENT;
+    return mojo::files::Error::INVALID_ARGUMENT;
   }
 
   // |base::HandleType| is just a typedef for |pid_t|.
@@ -104,19 +104,19 @@
 
   // Note: |kill()| is not interruptible.
   if (kill(pid, static_cast<int>(signal)) == 0)
-    return mojo::files::ERROR_OK;
+    return mojo::files::Error::OK;
 
   switch (errno) {
     case EINVAL:
-      return mojo::files::ERROR_INVALID_ARGUMENT;
+      return mojo::files::Error::INVALID_ARGUMENT;
     case EPERM:
-      return mojo::files::ERROR_PERMISSION_DENIED;
+      return mojo::files::Error::PERMISSION_DENIED;
     case ESRCH:
-      return mojo::files::ERROR_UNAVAILABLE;
+      return mojo::files::Error::UNAVAILABLE;
     default:
       break;
   }
-  return mojo::files::ERROR_UNKNOWN;
+  return mojo::files::Error::UNKNOWN;
 }
 
 }  // namespace native_support