Revert "Add some shady methods to get V8 objects or arrays from NSDictionary or NSArray."
authorCharlie Hess <charlie@slack-corp.com>
Tue, 3 May 2016 17:32:42 +0000 (10:32 -0700)
committerCharlie Hess <charlie@slack-corp.com>
Tue, 3 May 2016 17:32:42 +0000 (10:32 -0700)
This reverts commit 2295f3a8327d6df4031dcfcd8daebb771d0e3530.

atom/browser/mac/atom_application_delegate.mm
atom/browser/mac/mac_native_converter.h [deleted file]
atom/browser/mac/mac_native_converter.mm [deleted file]
filenames.gypi

index f08cc84..33aa47c 100644 (file)
@@ -63,9 +63,9 @@
 continueUserActivity:(NSUserActivity *)userActivity
   restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler {
   std::string activity_type(base::SysNSStringToUTF8(userActivity.activityType));
-
+  
   std::map<std::string, std::string> user_info;
-
+  
   NSArray* keys = [userActivity.userInfo allKeys];
   for (NSString* key in keys)
   {
diff --git a/atom/browser/mac/mac_native_converter.h b/atom/browser/mac/mac_native_converter.h
deleted file mode 100644 (file)
index ac1a9a6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#import <Cocoa/Cocoa.h>
-
-#include "base/values.h"
-#include "base/strings/sys_string_conversions.h"
-
-@interface MacNativeConverter : NSObject
-
-- (base::ListValue*)arrayToV8:(NSArray*)nsArray;
-- (base::DictionaryValue*)dictionaryToV8:(NSDictionary*)nsDictionary;
-
-@end
diff --git a/atom/browser/mac/mac_native_converter.mm b/atom/browser/mac/mac_native_converter.mm
deleted file mode 100644 (file)
index 6324403..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#import "atom/browser/mac/mac_native_converter.h"
-
-@implementation MacNativeConverter
-
-- (base::ListValue*)arrayToV8:(NSArray*)nsArray {
-  scoped_ptr<base::ListValue> list(new base::ListValue);
-
-  for (id value in nsArray) {
-    if ([value isKindOfClass:[NSArray class]]) {
-      list->Append([self arrayToV8:value]);
-    } else if ([value isKindOfClass:[NSDictionary class]]) {
-      list->Append([self dictionaryToV8:value]);
-    } else if ([value isKindOfClass:[NSString class]]) {
-      list->AppendString(base::SysNSStringToUTF8(value));
-    } else if ([value isKindOfClass:[NSNumber class]]) {
-      list->AppendInteger(((NSNumber* )value).intValue);
-    }
-  }
-
-  return list.get();
-}
-
-- (base::DictionaryValue*)dictionaryToV8:(NSDictionary*)nsDictionary {
-  scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
-
-  NSEnumerator *it = [nsDictionary keyEnumerator];
-  while (NSString *key = [it nextObject]) {
-    id value = [nsDictionary objectForKey:key];
-
-    std::string key_str(base::SysNSStringToUTF8(key));
-
-    if ([value isKindOfClass:[NSArray class]]) {
-      dict->Set(key_str, [self arrayToV8:value]);
-    } else if ([value isKindOfClass:[NSDictionary class]]) {
-      dict->Set(key_str, [self dictionaryToV8:value]);
-    } else if ([value isKindOfClass:[NSString class]]) {
-      dict->SetString(key_str, base::SysNSStringToUTF8(value));
-    } else if ([value isKindOfClass:[NSNumber class]]) {
-      dict->SetInteger(key_str, ((NSNumber* )value).intValue);
-    }
-  }
-
-  return dict.get();
-}
-
-@end
index 033d495..783b5cb 100644 (file)
       'atom/browser/mac/atom_application.mm',
       'atom/browser/mac/atom_application_delegate.h',
       'atom/browser/mac/atom_application_delegate.mm',
-      'atom/browser/mac/mac_native_converter.h',
-      'atom/browser/mac/mac_native_converter.mm',
       'atom/browser/native_window.cc',
       'atom/browser/native_window.h',
       'atom/browser/native_window_views_win.cc',