'atom/common/crash_reporter/win/crash_service_main.h',
'atom/common/draggable_region.cc',
'atom/common/draggable_region.h',
+ 'atom/common/google_api_key.h',
'atom/common/linux/application_info.cc',
'atom/common/native_mate_converters/accelerator_converter.cc',
'atom/common/native_mate_converters/accelerator_converter.h',
#include "atom/app/atom_content_client.h"
#include "atom/browser/atom_browser_client.h"
+#include "atom/common/google_api_key.h"
#include "atom/renderer/atom_renderer_client.h"
#include "base/command_line.h"
#include "base/debug/stack_trace.h"
+#include "base/environment.h"
#include "base/logging.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
void AtomMainDelegate::PreSandboxStartup() {
brightray::MainDelegate::PreSandboxStartup();
+ // Set google API key.
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ if (!env->HasVar("GOOGLE_API_KEY"))
+ env->SetVar("GOOGLE_API_KEY", GOOGLEAPIS_API_KEY);
+
CommandLine* command_line = CommandLine::ForCurrentProcess();
std::string process_type = command_line->GetSwitchValueASCII(
switches::kProcessType);
#include <utility>
#include "atom/browser/atom_browser_context.h"
-
-#ifndef GOOGLEAPIS_API_KEY
-#define GOOGLEAPIS_API_KEY "AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q"
-#endif
+#include "atom/common/google_api_key.h"
namespace atom {
--- /dev/null
+// Copyright (c) 2014 GitHub, Inc. All rights reserved.
+// Use of this source code is governed by the MIT license that can be
+// found in the LICENSE file.
+
+#ifndef ATOM_COMMON_GOOGLE_API_KEY_H_
+#define ATOM_COMMON_GOOGLE_API_KEY_H_
+
+#ifndef GOOGLEAPIS_API_KEY
+#define GOOGLEAPIS_API_KEY "AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q"
+#endif
+
+#endif // ATOM_COMMON_GOOGLE_API_KEY_H_