]> khamidou — GitHub mirrors - electron.git/commitdiff
Rename hard-coded application names in code
authorCheng Zhao <zcbenz@gmail.com>
Tue, 14 Apr 2015 07:55:41 +0000 (15:55 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 14 Apr 2015 07:55:41 +0000 (15:55 +0800)
13 files changed:
atom/browser/browser_linux.cc
atom/browser/browser_mac.mm
atom/browser/browser_win.cc
atom/browser/default_app/index.html
atom/browser/default_app/main.js
atom/browser/default_app/package.json
atom/browser/node_debugger.cc
atom/common/crash_reporter/crash_reporter_linux.cc
atom/common/crash_reporter/crash_reporter_mac.mm
atom/common/crash_reporter/crash_reporter_win.cc
atom/common/crash_reporter/win/crash_service_main.cc
atom/common/linux/application_info.cc
atom/renderer/lib/override.coffee

index 7534aa2182d9babbefb7b364cd9388d962b06179..ea8fb7c10c5ddfbaf1b83d3cfb28bb4e2039f22b 100644 (file)
@@ -9,6 +9,7 @@
 #include "atom/browser/native_window.h"
 #include "atom/browser/window_list.h"
 #include "atom/common/atom_version.h"
+#include "brightray/common/application_info.h"
 
 namespace atom {
 
@@ -31,11 +32,11 @@ void Browser::ClearRecentDocuments() {
 }
 
 std::string Browser::GetExecutableFileVersion() const {
-  return ATOM_VERSION_STRING;
+  return brightray::GetApplicationVersion();
 }
 
 std::string Browser::GetExecutableFileProductName() const {
-  return "Atom-Shell";
+  return brightray::GetApplicationName();
 }
 
 }  // namespace atom
index 06c2b434779963d1bef335098710820fdc6736c2..2353aa6c42c3cce998303be7da9b1ae020e223ac 100644 (file)
@@ -4,13 +4,13 @@
 
 #include "atom/browser/browser.h"
 
-#import "atom/browser/mac/atom_application.h"
-#import "atom/browser/mac/atom_application_delegate.h"
+#include "atom/browser/mac/atom_application.h"
+#include "atom/browser/mac/atom_application_delegate.h"
 #include "atom/browser/native_window.h"
 #include "atom/browser/window_list.h"
-#import "base/mac/bundle_locations.h"
-#import "base/mac/foundation_util.h"
+#include "base/mac/foundation_util.h"
 #include "base/strings/sys_string_conversions.h"
+#include "brightray/common/application_info.h"
 
 namespace atom {
 
@@ -27,15 +27,11 @@ void Browser::ClearRecentDocuments() {
 }
 
 std::string Browser::GetExecutableFileVersion() const {
-  NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
-  NSString *version = [infoDictionary objectForKey:@"CFBundleVersion"];
-  return base::SysNSStringToUTF8(version);
+  return brightray::GetApplicationVersion();
 }
 
 std::string Browser::GetExecutableFileProductName() const {
-  NSDictionary* infoDictionary = base::mac::OuterBundle().infoDictionary;
-  NSString *version = [infoDictionary objectForKey:@"CFBundleName"];
-  return base::SysNSStringToUTF8(version);
+  return brightray::GetApplicationName();
 }
 
 int Browser::DockBounce(BounceType type) {
index 211a1ebf63df4be93affcd0236522d9f1328f3bc..b861af945421a5cf009b3db572df4798427981cd 100644 (file)
@@ -118,7 +118,7 @@ void Browser::SetUserTasks(const std::vector<UserTask>& tasks) {
 }
 
 void Browser::SetAppUserModelID(const std::string& name) {
-  app_user_model_id_ = base::string16(L"atom-shell.app.");
+  app_user_model_id_ = base::string16(L"electron.app.");
   app_user_model_id_ += base::UTF8ToUTF16(name);
   SetCurrentProcessExplicitAppUserModelID(app_user_model_id_.c_str());
 }
@@ -142,7 +142,7 @@ std::string Browser::GetExecutableFileProductName() const {
     return base::UTF16ToUTF8(version_info->product_name());
   }
 
-  return "Atom-Shell";
+  return ATOM_PRODUCT_NAME;
 }
 
 }  // namespace atom
index 469b57cdad1db840b684b8b12407bbaa6b745e90..96e45806d5dd39dba510a8250e5ab3d5ca768563 100644 (file)
   <h2 style="-webkit-app-region: drag">Welcome to Electron</h2>
 
   <p>
-  To run your app with atom-shell, execute the following command under your
+  To run your app with Electron, execute the following command under your
   Console (or Terminal):
   </p>
 
   <script>document.write('<pre>' + command + '</pre>')</script>
 
   <p>
-  The <code>path-to-your-app</code> should be the path to your own atom-shell
-  app, you can read the <a href='https://github.com/atom/atom-shell/blob/master/docs/tutorial/quick-start.md'>quick start</a>
-  guide in atom-shell's <a href='https://github.com/atom/atom-shell/blob/master/docs'>docs</a>
+  The <code>path-to-your-app</code> should be the path to your own Electron
+  app, you can read the <a href='https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md'>quick start</a>
+  guide in Electron's <a href='https://github.com/atom/electron/blob/master/docs'>docs</a>
   on how to write one.
   </p>
 
index 06de0e26529ccc858615f6ca0f6a4c3009d1d15d..bdb88a7cc29a908dc1bf132b2a551cec5c152f4e 100644 (file)
@@ -50,7 +50,7 @@ if (option.file && !option.webdriver) {
   } catch(e) {
     if (e.code == 'MODULE_NOT_FOUND') {
       app.focus();
-      dialog.showErrorBox('Error opening app', 'The app provided is not a valid atom-shell app, please read the docs on how to write one:\nhttps://github.com/atom/atom-shell/tree/master/docs');
+      dialog.showErrorBox('Error opening app', 'The app provided is not a valid electron app, please read the docs on how to write one:\nhttps://github.com/atom/electron/tree/master/docs');
       process.exit(1);
     } else {
       console.error('App threw an error when running', e);
@@ -58,7 +58,7 @@ if (option.file && !option.webdriver) {
     }
   }
 } else if (option.version) {
-  console.log('v' + process.versions['atom-shell']);
+  console.log('v' + process.versions['electron']);
   process.exit(0);
 } else {
   require('./default_app.js');
index 28305088f3d9ae135447718c8200aa741bd55c4d..d6c736cbc5253b22fee67290333f769a21291d42 100644 (file)
@@ -1,6 +1,5 @@
 {
-  "name": "atom-shell-default-app",
-  "productName": "Electron Default App",
-  "version": "0.1.0",
+  "name": "electron",
+  "productName": "Electron",
   "main": "main.js"
 }
index 0b8cc3bcbc3162b811f30224c4c8d7d52e496a30..4e2302763c7e39aa30e2d37e0202cac56d3e617d 100644 (file)
@@ -126,7 +126,7 @@ void NodeDebugger::SendConnectMessage() {
       "Protocol-Version: 1\r\n"
       "Embedding-Host: %s\r\n"
       "%s: 0\r\n",
-      v8::V8::GetVersion(), "Atom-Shell", kContentLength), true);
+      v8::V8::GetVersion(), ATOM_PRODUCT_NAME, kContentLength), true);
 }
 
 // static
index 89e2f7e76a2973b97306f497d51a96e0af86f550..8a5608dad0cb7dc7ca6ad389bb99c38758131f27 100644 (file)
@@ -64,7 +64,7 @@ void CrashReporterLinux::InitBreakpad(const std::string& product_name,
                                       bool skip_system_crash_handler) {
   EnableCrashDumping(product_name);
 
-  crash_keys_.SetKeyValue("prod", "Atom-Shell");
+  crash_keys_.SetKeyValue("prod", ATOM_PRODUCT_NAME);
   crash_keys_.SetKeyValue("ver", version.c_str());
   upload_url_ = submit_url;
 
index 5875bc78f0f65138df833a2a45af93d0802c7580..c251e0e0d10062bbc9c0595557c921af5ee9d04d 100644 (file)
@@ -32,7 +32,7 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name,
   NSMutableDictionary* parameters =
       [NSMutableDictionary dictionaryWithCapacity:4];
 
-  [parameters setValue:@"Atom-Shell"
+  [parameters setValue:@ATOM_PRODUCT_NAME
                 forKey:@BREAKPAD_PRODUCT];
   [parameters setValue:base::SysUTF8ToNSString(product_name)
                 forKey:@BREAKPAD_PRODUCT_DISPLAY];
index 6164a508db857a7d31d7766ccc104f14619ea6d3..e5c5edc582aebd91b4980dfd176752af33ddd2d9 100644 (file)
@@ -103,7 +103,7 @@ google_breakpad::CustomClientInfo* CrashReporterWin::GetCustomInfo(
   custom_info_entries_.reserve(2 + upload_parameters_.size());
 
   custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
-      L"prod", L"Atom-Shell"));
+      L"prod", L"Electron"));
   custom_info_entries_.push_back(google_breakpad::CustomInfoEntry(
       L"ver", base::UTF8ToWide(version).c_str()));
 
index dd2d8fbab6d3cd11ed7e3db4e0c8f778db8a202f..0bd72deba9e97a76a4fc3a7cf9cc429489d1f192 100644 (file)
@@ -73,7 +73,7 @@ int Main(const wchar_t* cmd) {
                                                  NULL);
   cmd_line.AppendSwitch("no-window");
   cmd_line.AppendSwitchASCII("max-reports", "128");
-  cmd_line.AppendSwitchASCII("reporter", "atom-shell-crash-service");
+  cmd_line.AppendSwitchASCII("reporter", ATOM_PROJECT_NAME "-crash-service");
   cmd_line.AppendSwitchNative("pipe-name", pipe_name);
 
   breakpad::CrashService crash_service;
index 7bbb9d425a9c18c7d918821aa23d40ede3da2683..053bd4bb8634ccdc9903ec18cffa8ecdce410eaa 100644 (file)
@@ -9,7 +9,7 @@
 namespace brightray {
 
 std::string GetApplicationName() {
-  return "Atom-Shell";
+  return ATOM_PRODUCT_NAME;
 }
 
 std::string GetApplicationVersion() {
index bb469711adf38a07e4b879a81cd009c82f6b93ce..6e02c2eb8222c30f6deefe5afee02d5ab3031d9c 100644 (file)
@@ -72,7 +72,7 @@ window.confirm = (message, title='') ->
 
 # But we do not support prompt().
 window.prompt = ->
-  throw new Error('prompt() is and will not be supported in atom-shell.')
+  throw new Error('prompt() is and will not be supported.')
 
 window.opener =
   postMessage: (message, targetOrigin='*') ->