Commit fbcfdaeb authored by rdevlin.cronin's avatar rdevlin.cronin Committed by Commit bot

[UI Views] Unset the extension keybinding registry on frame destruction

Some destruction flows don't seem to call OnWidgetActivationChanged
before destroying the window, which causes the extension keybinding
registry reference in the global registry to become stale. Update the
active registry on deletion.

BUG=616970

Review-Url: https://codereview.chromium.org/2046653002
Cr-Commit-Position: refs/heads/master@{#398167}
parent 4d3274ee
...@@ -479,6 +479,12 @@ BrowserView::~BrowserView() { ...@@ -479,6 +479,12 @@ BrowserView::~BrowserView() {
} }
#endif #endif
extensions::ExtensionCommandsGlobalRegistry* global_registry =
extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile());
if (global_registry->registry_for_active_window() ==
extension_keybinding_registry_.get())
global_registry->set_registry_for_active_window(nullptr);
// We destroy the download shelf before |browser_| to remove its child // We destroy the download shelf before |browser_| to remove its child
// download views from the set of download observers (since the observed // download views from the set of download observers (since the observed
// downloads can be destroyed along with |browser_| and the observer // downloads can be destroyed along with |browser_| and the observer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment