*prevent_default = Emit("open-file", &args);
}
+void App::OnWillFinishLaunching() {
+ Emit("will-finish-launching");
+}
+
void App::OnFinishLaunching() {
Emit("finish-launching");
}
virtual void OnWindowAllClosed() OVERRIDE;
virtual void OnOpenFile(bool* prevent_default,
const std::string& file_path) OVERRIDE;
+ virtual void OnWillFinishLaunching() OVERRIDE;
virtual void OnFinishLaunching() OVERRIDE;
private:
@implementation AtomApplicationDelegate
+- (void)applicationWillFinishLaunching:(NSNotification*)notify {
+ atom::Browser::Get()->WillFinishLaunching();
+}
+
- (void)applicationDidFinishLaunching:(NSNotification*)notify {
// Trap the quit message to handleQuitEvent.
NSAppleEventManager* em = [NSAppleEventManager sharedAppleEventManager];
#if !defined(OS_MACOSX)
// The corresponding call in OS X is in AtomApplicationDelegate.
+ Browser::Get()->WillFinishLaunching();
Browser::Get()->DidFinishLaunching();
#endif
}
return prevent_default;
}
+void Browser::WillFinishLaunching() {
+ FOR_EACH_OBSERVER(BrowserObserver, observers_, OnWillFinishLaunching());
+}
+
void Browser::DidFinishLaunching() {
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
}
bool OpenFile(const std::string& file_path);
// Tell the application the loading has been done.
+ void WillFinishLaunching();
void DidFinishLaunching();
void AddObserver(BrowserObserver* obs) {
const std::string& file_path) {}
// The browser has finished loading.
+ virtual void OnWillFinishLaunching() {}
virtual void OnFinishLaunching() {}
protected: