return -1;
}
+// Run the NotificationCallback and returns whether browser is shuting down.
+bool NotificationCallbackWrapper(
+ const ProcessSingleton::NotificationCallback& callback,
+ const base::CommandLine& command_line,
+ const base::FilePath& current_directory) {
+ callback.Run(command_line, current_directory);
+ return !Browser::Get()->is_shutting_down();
+}
+
void OnClientCertificateSelected(
v8::Isolate* isolate,
std::shared_ptr<content::ClientCertificateDelegate> delegate,
return v8::Local<v8::Value>::New(isolate, default_session_);
}
-bool App::MakeSingleInstance(ProcessSingleton::NotificationCallback callback) {
+bool App::MakeSingleInstance(
+ const ProcessSingleton::NotificationCallback& callback) {
#if defined(OS_MACOSX)
LOG(ERROR) << "MakeSingleInstance is not implemnted on OS X";
return false;
PathService::Get(brightray::DIR_USER_DATA, &user_dir);
process_singleton_startup_lock_.reset(
- new ProcessSingletonStartupLock(callback));
+ new ProcessSingletonStartupLock(
+ base::Bind(NotificationCallbackWrapper, callback)));
process_singleton_.reset(
new ProcessSingleton(
user_dir,
void SetDesktopName(const std::string& desktop_name);
void SetAppUserModelId(const std::string& app_id);
-
void AllowNTLMCredentialsForAllDomains(bool should_allow);
-
- bool MakeSingleInstance(ProcessSingleton::NotificationCallback callback);
-
+ bool MakeSingleInstance(
+ const ProcessSingleton::NotificationCallback& callback);
std::string GetLocale();
v8::Local<v8::Value> DefaultSession(v8::Isolate* isolate);
observers_.RemoveObserver(obs);
}
+ bool is_shutting_down() const { return is_shutdown_; }
bool is_quiting() const { return is_quiting_; }
bool is_ready() const { return is_ready_; }