No need to get BrowserContext from NativeWindow

This commit is contained in:
Cheng Zhao 2018-03-06 15:32:00 +09:00
parent 702f1631a3
commit 8bbe28e998
2 changed files with 2 additions and 7 deletions

View file

@ -990,7 +990,6 @@ NativeWindowMac::NativeWindowMac(
NativeWindowMac::~NativeWindowMac() { NativeWindowMac::~NativeWindowMac() {
[NSEvent removeMonitor:wheel_event_monitor_]; [NSEvent removeMonitor:wheel_event_monitor_];
Observe(nullptr);
} }
void NativeWindowMac::Close() { void NativeWindowMac::Close() {

View file

@ -235,12 +235,8 @@ void WebDialogHelper::RunFileChooser(
NOTREACHED(); NOTREACHED();
} }
AtomBrowserContext* browser_context = static_cast<AtomBrowserContext*>( auto* browser_context = static_cast<atom::AtomBrowserContext*>(
window_->web_contents()->GetBrowserContext()); render_frame_host->GetProcess()->GetBrowserContext());
if (!browser_context) {
browser_context = static_cast<atom::AtomBrowserContext*>(
render_frame_host->GetProcess()->GetBrowserContext());
}
settings.default_path = browser_context->prefs()->GetFilePath( settings.default_path = browser_context->prefs()->GetFilePath(
prefs::kSelectFileLastDirectory).Append(params.default_file_name); prefs::kSelectFileLastDirectory).Append(params.default_file_name);
settings.properties = flags; settings.properties = flags;