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

Unified Diff: extensions/renderer/bindings/api_binding_util.cc

Issue 2967443004: [Extensions Bindings] Fix getPlatform() method (Closed)
Patch Set: Rebase Created 3 years, 5 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: extensions/renderer/bindings/api_binding_util.cc
diff --git a/extensions/renderer/bindings/api_binding_util.cc b/extensions/renderer/bindings/api_binding_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2dae6f8305e15ade77af24d55a87bd4873968e06
--- /dev/null
+++ b/extensions/renderer/bindings/api_binding_util.cc
@@ -0,0 +1,29 @@
+// Copyright 2017 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.
+
+#include "extensions/renderer/bindings/api_binding_util.h"
+
+#include "base/logging.h"
+#include "build/build_config.h"
+
+namespace extensions {
+namespace binding {
+
+std::string GetPlatformString() {
+#if defined(OS_CHROMEOS)
+ return "chromeos";
+#elif defined(OS_LINUX)
+ return "linux";
+#elif defined(OS_MACOSX)
+ return "mac";
+#elif defined(OS_WIN)
+ return "win";
+#else
+ NOTREACHED();
+ return std::string();
+#endif
+}
+
+} // namespace binding
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698