I was wondering about the entire block wrapped in if (!brackets.nativeMenus) { ...} 

I assume that this is to support legacy menus that brackets doesn't have any more? Why is it here?