Merge pull request #407 from atom/detached-devtools

Enable detached devtools
This commit is contained in:
Cheng Zhao
2014-06-17 18:40:57 +08:00
4 changed files with 12 additions and 24 deletions

View File

@@ -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) {

View File

@@ -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;

View File

@@ -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() {