| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/accelerators/debug_commands.h" | 5 #include "ash/common/accelerators/debug_commands.h" |
| 6 | 6 |
| 7 #include "ash/common/accelerators/accelerator_commands.h" | 7 #include "ash/common/accelerators/accelerator_commands.h" |
| 8 #include "ash/common/ash_switches.h" | 8 #include "ash/common/ash_switches.h" |
| 9 #include "ash/common/shell_delegate.h" | 9 #include "ash/common/shell_delegate.h" |
| 10 #include "ash/common/system/toast/toast_data.h" | 10 #include "ash/common/system/toast/toast_data.h" |
| 11 #include "ash/common/system/toast/toast_manager.h" | 11 #include "ash/common/system/toast/toast_manager.h" |
| 12 #include "ash/common/wallpaper/wallpaper_controller.h" | 12 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 13 #include "ash/common/wallpaper/wallpaper_delegate.h" | 13 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 14 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 15 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 16 #include "ash/common/wm_window.h" | 16 #include "ash/common/wm_window.h" |
| 17 #include "ash/common/wm_window_property.h" |
| 17 #include "ash/root_window_controller.h" | 18 #include "ash/root_window_controller.h" |
| 18 #include "base/command_line.h" | 19 #include "base/command_line.h" |
| 19 #include "base/metrics/user_metrics.h" | 20 #include "base/metrics/user_metrics.h" |
| 20 #include "base/metrics/user_metrics_action.h" | 21 #include "base/metrics/user_metrics_action.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 22 #include "ui/compositor/debug_utils.h" | 23 #include "ui/compositor/debug_utils.h" |
| 24 #include "ui/compositor/layer.h" |
| 23 #include "ui/gfx/canvas.h" | 25 #include "ui/gfx/canvas.h" |
| 24 #include "ui/gfx/image/image_skia.h" | 26 #include "ui/gfx/image/image_skia.h" |
| 25 #include "ui/views/debug_utils.h" | 27 #include "ui/views/debug_utils.h" |
| 26 #include "ui/views/widget/widget.h" | 28 #include "ui/views/widget/widget.h" |
| 27 | 29 |
| 28 namespace ash { | 30 namespace ash { |
| 29 namespace debug { | 31 namespace debug { |
| 30 namespace { | 32 namespace { |
| 31 | 33 |
| 32 void HandlePrintLayerHierarchy() { | 34 void HandlePrintLayerHierarchy() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 53 int indent, | 55 int indent, |
| 54 std::ostringstream* out) { | 56 std::ostringstream* out) { |
| 55 std::string indent_str(indent, ' '); | 57 std::string indent_str(indent, ' '); |
| 56 std::string name(window->GetName()); | 58 std::string name(window->GetName()); |
| 57 if (name.empty()) | 59 if (name.empty()) |
| 58 name = "\"\""; | 60 name = "\"\""; |
| 59 *out << indent_str << name << " (" << window << ")" | 61 *out << indent_str << name << " (" << window << ")" |
| 60 << " type=" << window->GetType() | 62 << " type=" << window->GetType() |
| 61 << ((window == active_window) ? " [active] " : " ") | 63 << ((window == active_window) ? " [active] " : " ") |
| 62 << (window->IsVisible() ? " visible " : " ") | 64 << (window->IsVisible() ? " visible " : " ") |
| 63 << window->GetBounds().ToString() << '\n'; | 65 << window->GetBounds().ToString() |
| 66 << (window->GetBoolProperty( |
| 67 WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY) |
| 68 ? " [snapped] " |
| 69 : "") |
| 70 << ", subpixel offset=" |
| 71 << window->GetLayer()->subpixel_position_offset().ToString() << '\n'; |
| 64 | 72 |
| 65 for (WmWindow* child : window->GetChildren()) | 73 for (WmWindow* child : window->GetChildren()) |
| 66 PrintWindowHierarchy(active_window, child, indent + 3, out); | 74 PrintWindowHierarchy(active_window, child, indent + 3, out); |
| 67 } | 75 } |
| 68 | 76 |
| 69 void HandlePrintWindowHierarchy() { | 77 void HandlePrintWindowHierarchy() { |
| 70 WmWindow* active_window = WmShell::Get()->GetActiveWindow(); | 78 WmWindow* active_window = WmShell::Get()->GetActiveWindow(); |
| 71 WmWindow::Windows roots = WmShell::Get()->GetAllRootWindows(); | 79 WmWindow::Windows roots = WmShell::Get()->GetAllRootWindows(); |
| 72 for (size_t i = 0; i < roots.size(); ++i) { | 80 for (size_t i = 0; i < roots.size(); ++i) { |
| 73 std::ostringstream out; | 81 std::ostringstream out; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 case DEBUG_TRIGGER_CRASH: | 213 case DEBUG_TRIGGER_CRASH: |
| 206 HandleTriggerCrash(); | 214 HandleTriggerCrash(); |
| 207 break; | 215 break; |
| 208 default: | 216 default: |
| 209 break; | 217 break; |
| 210 } | 218 } |
| 211 } | 219 } |
| 212 | 220 |
| 213 } // namespace debug | 221 } // namespace debug |
| 214 } // namespace ash | 222 } // namespace ash |
| OLD | NEW |