mirror of
https://github.com/electron/electron.git
synced 2026-01-11 00:18:02 -05:00
Merge pull request #407 from atom/detached-devtools
Enable detached devtools
This commit is contained in:
@@ -569,22 +569,6 @@ void NativeWindow::Observe(int type,
|
||||
}
|
||||
}
|
||||
|
||||
bool NativeWindow::DevToolsSetDockSide(const std::string& dock_side,
|
||||
bool* succeed) {
|
||||
if (dock_side == "undocked") {
|
||||
*succeed = false;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool NativeWindow::DevToolsShow(std::string* dock_side) {
|
||||
if (*dock_side == "undocked")
|
||||
*dock_side = "bottom";
|
||||
return false;
|
||||
}
|
||||
|
||||
void NativeWindow::DevToolsSaveToFile(const std::string& url,
|
||||
const std::string& content,
|
||||
bool save_as) {
|
||||
|
||||
@@ -242,9 +242,6 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
|
||||
const content::NotificationDetails& details) OVERRIDE;
|
||||
|
||||
// Implementations of brightray::InspectableWebContentsDelegate.
|
||||
virtual bool DevToolsSetDockSide(const std::string& dock_side,
|
||||
bool* succeed) OVERRIDE;
|
||||
virtual bool DevToolsShow(std::string* dock_side) OVERRIDE;
|
||||
virtual void DevToolsSaveToFile(const std::string& url,
|
||||
const std::string& content,
|
||||
bool save_as) OVERRIDE;
|
||||
|
||||
@@ -504,10 +504,17 @@ void NativeWindowMac::HandleKeyboardEvent(
|
||||
event.type == content::NativeWebKeyboardEvent::Char)
|
||||
return;
|
||||
|
||||
EventProcessingWindow* event_window =
|
||||
static_cast<EventProcessingWindow*>(window_);
|
||||
DCHECK([event_window isKindOfClass:[EventProcessingWindow class]]);
|
||||
[event_window redispatchKeyEvent:event.os_event];
|
||||
if (event.os_event.window == window_) {
|
||||
EventProcessingWindow* event_window =
|
||||
static_cast<EventProcessingWindow*>(window_);
|
||||
DCHECK([event_window isKindOfClass:[EventProcessingWindow class]]);
|
||||
[event_window redispatchKeyEvent:event.os_event];
|
||||
} else {
|
||||
// The event comes from detached devtools view, and it has already been
|
||||
// handled by the devtools itself, we now send it to application menu to
|
||||
// make menu acclerators work.
|
||||
[[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
||||
}
|
||||
}
|
||||
|
||||
void NativeWindowMac::InstallView() {
|
||||
|
||||
2
vendor/brightray
vendored
2
vendor/brightray
vendored
Submodule vendor/brightray updated: e6db5b381b...45ab10c1e6
Reference in New Issue
Block a user