// Focus the application.
void Focus();
+ // Returns the version of the executable (or bundle).
+ std::string GetVersion();
+
// Tell the application to open a file.
bool OpenFile(const std::string& file_path);
#include "browser/browser.h"
+#import "base/mac/bundle_locations.h"
+#include "base/strings/sys_string_conversions.h"
#import "browser/atom_application_mac.h"
namespace atom {
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}
+std::string Browser::GetVersion() {
+ NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
+ NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
+ return base::SysNSStringToUTF8(version);
+}
+
} // namespace atom