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
commit f0e297ba77
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() {

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit e6db5b381b2d5f721ab3de3fa9b811e112a18b12
Subproject commit 45ab10c1e6743ab1e6eafb9940d4913f7754914f