| Index: ash/accelerators/accelerator_controller.cc
|
| diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
|
| index 0840b56ed4aee7de5b5175372b5784afb8896019..337e9198ecac032e67405e0667aa340a13af3c68 100644
|
| --- a/ash/accelerators/accelerator_controller.cc
|
| +++ b/ash/accelerators/accelerator_controller.cc
|
| @@ -279,15 +279,13 @@ bool HandlePrintLayerHierarchy() {
|
| }
|
|
|
| bool HandlePrintViewHierarchy() {
|
| - aura::Window* default_container =
|
| - Shell::GetPrimaryRootWindowController()->GetContainer(
|
| - internal::kShellWindowId_DefaultContainer);
|
| - if (default_container->children().empty())
|
| + aura::Window* active_window = ash::wm::GetActiveWindow();
|
| + if (!active_window)
|
| return true;
|
| - aura::Window* browser_frame = default_container->children()[0];
|
| views::Widget* browser_widget =
|
| - views::Widget::GetWidgetForNativeWindow(browser_frame);
|
| - views::PrintViewHierarchy(browser_widget->GetRootView());
|
| + views::Widget::GetWidgetForNativeWindow(active_window);
|
| + if (browser_widget)
|
| + views::PrintViewHierarchy(browser_widget->GetRootView());
|
| return true;
|
| }
|
|
|
|
|