'browser/api/atom_api_browser_ipc.cc',
'browser/api/atom_api_browser_ipc.h',
'browser/api/atom_api_crash_reporter.h',
- 'browser/api/atom_api_crash_reporter_mac.mm',
+ 'browser/api/atom_api_crash_reporter.cc',
'browser/api/atom_api_dialog.cc',
'browser/api/atom_api_dialog.h',
'browser/api/atom_api_event.cc',
'browser/browser.h',
'browser/browser_mac.mm',
'browser/browser_observer.h',
+ 'browser/crash_reporter.h',
+ 'browser/crash_reporter_mac.mm',
+ 'browser/crash_reporter_win.cc',
'browser/file_dialog.h',
'browser/file_dialog_mac.mm',
'browser/media/media_capture_devices_dispatcher.cc',
#include "browser/api/atom_api_crash_reporter.h"
-#import <Quincy/BWQuincyManager.h>
-
-#include "base/strings/sys_string_conversions.h"
+#include "browser/crash_reporter.h"
#include "vendor/node/src/node.h"
#include "vendor/node/src/node_internals.h"
namespace api {
-namespace {
-
-// Converts a V8 value to a string16.
-string16 V8ValueToUTF16(v8::Handle<v8::Value> value) {
- v8::String::Value s(value);
- return string16(reinterpret_cast<const char16*>(*s), s.length());
-}
-
-} // namespace
-
// static
v8::Handle<v8::Value> CrashReporter::SetCompanyName(const v8::Arguments &args) {
- BWQuincyManager *manager = [BWQuincyManager sharedQuincyManager];
- string16 str(V8ValueToUTF16(args[0]));
- [manager setCompanyName:base::SysUTF16ToNSString(str)];
+ std::string name(*v8::String::Utf8Value(args[0]));
+ crash_reporter::CrashReporter::SetCompanyName(name);
return v8::Undefined();
}
// static
v8::Handle<v8::Value> CrashReporter::SetSubmissionURL(
const v8::Arguments &args) {
- BWQuincyManager *manager = [BWQuincyManager sharedQuincyManager];
- string16 str(V8ValueToUTF16(args[0]));
- [manager setSubmissionURL:base::SysUTF16ToNSString(str)];
+ std::string url(*v8::String::Utf8Value(args[0]));
+ crash_reporter::CrashReporter::SetSubmissionURL(url);
return v8::Undefined();
}
// static
v8::Handle<v8::Value> CrashReporter::SetAutoSubmit(const v8::Arguments &args) {
- BWQuincyManager *manager = [BWQuincyManager sharedQuincyManager];
- [manager setAutoSubmitCrashReport:args[0]->BooleanValue()];
+ crash_reporter::CrashReporter::SetAutoSubmit(args[0]->BooleanValue());
return v8::Undefined();
}
--- /dev/null
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_BROWSER_CRASH_REPORTER_H_
+#define ATOM_BROWSER_CRASH_REPORTER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace crash_reporter {
+
+class CrashReporter {
+ public:
+ static void SetCompanyName(const std::string& name);
+ static void SetSubmissionURL(const std::string& url);
+ static void SetAutoSubmit(bool yes);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(CrashReporter);
+};
+
+} // namespace crash_reporter
+
+#endif // ATOM_BROWSER_CRASH_REPORTER_H_
--- /dev/null
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "browser/crash_reporter.h"
+
+#import <Quincy/BWQuincyManager.h>
+
+#include "base/strings/sys_string_conversions.h"
+
+namespace crash_reporter {
+
+// static
+void CrashReporter::SetCompanyName(const std::string& name) {
+ BWQuincyManager *manager = [BWQuincyManager sharedQuincyManager];
+ [manager setCompanyName:base::SysUTF8ToNSString(name)];
+}
+
+// static
+void CrashReporter::SetSubmissionURL(const std::string& url) {
+ BWQuincyManager *manager = [BWQuincyManager sharedQuincyManager];
+ [manager setSubmissionURL:base::SysUTF8ToNSString(name)];
+ return v8::Undefined();
+}
+
+// static
+void CrashReporter::SetAutoSubmit(bool yes) {
+ BWQuincyManager *manager = [BWQuincyManager sharedQuincyManager];
+ [manager setAutoSubmitCrashReport:yes];
+}
+
+} // namespace crash_reporter
--- /dev/null
+// Copyright (c) 2013 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "browser/crash_reporter.h"
+
+namespace crash_reporter {
+
+// static
+void CrashReporter::SetCompanyName(const std::string& name) {
+}
+
+// static
+void CrashReporter::SetSubmissionURL(const std::string& url) {
+}
+
+// static
+void CrashReporter::SetAutoSubmit(bool yes) {
+}
+
+} // namespace crash_reporter
+