Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3669)

Unified Diff: athena/screen/screen_accelerator_handler.cc

Issue 687533002: Print activity state when Ctrl+Shift+Alt+W is pressed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move debug accelerators to DebugAcceleratorHandler Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/screen/screen_accelerator_handler.h ('k') | athena/screen/screen_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/screen/screen_accelerator_handler.cc
diff --git a/athena/screen/screen_accelerator_handler.cc b/athena/screen/screen_accelerator_handler.cc
index 97c08ec4aa38e45c366222eff2ead6c27cba45c3..90d990f278698f29ddc7a58399906d0efc7bfe24 100644
--- a/athena/screen/screen_accelerator_handler.cc
+++ b/athena/screen/screen_accelerator_handler.cc
@@ -6,70 +6,23 @@
#include "athena/input/public/accelerator_manager.h"
#include "athena/screen/public/screen_manager.h"
-#include "ui/aura/window.h"
-#include "ui/aura/window_event_dispatcher.h"
-#include "ui/aura/window_tree_host.h"
-#include "ui/compositor/debug_utils.h"
+#include "ui/events/event_constants.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
-#include "ui/wm/public/activation_client.h"
namespace athena {
namespace {
enum Command {
- CMD_PRINT_LAYER_HIERARCHY,
- CMD_PRINT_WINDOW_HIERARCHY,
CMD_ROTATE_SCREEN,
};
-const int EF_ALL_DOWN =
- ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN;
-
const AcceleratorData accelerator_data[] = {
- {TRIGGER_ON_PRESS, ui::VKEY_L, EF_ALL_DOWN, CMD_PRINT_LAYER_HIERARCHY,
- AF_DEBUG},
- {TRIGGER_ON_PRESS, ui::VKEY_W, EF_ALL_DOWN, CMD_PRINT_WINDOW_HIERARCHY,
- AF_DEBUG},
{TRIGGER_ON_PRESS, ui::VKEY_F3,
ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN,
CMD_ROTATE_SCREEN, AF_NONE},
};
-void PrintLayerHierarchy(aura::Window* root_window) {
- ui::PrintLayerHierarchy(
- root_window->layer(),
- root_window->GetHost()->dispatcher()->GetLastMouseLocationInRoot());
-}
-
-void PrintWindowHierarchy(aura::Window* window,
- aura::Window* active,
- int indent,
- std::ostringstream* out) {
- std::string indent_str(indent, ' ');
- std::string name(window->name());
- if (name.empty())
- name = "\"\"";
- *out << indent_str << name << " (" << window << ")"
- << " type=" << window->type()
- << ((window == active) ? " [active] " : " ")
- << (window->IsVisible() ? " visible " : " ")
- << window->bounds().ToString() << '\n';
-
- for (size_t i = 0; i < window->children().size(); ++i)
- PrintWindowHierarchy(window->children()[i], active, indent + 3, out);
-}
-
-void HandlePrintWindowHierarchy(aura::Window* root_window) {
- aura::Window* active =
- aura::client::GetActivationClient(root_window)->GetActiveWindow();
- std::ostringstream out;
- out << "RootWindow :\n";
- PrintWindowHierarchy(root_window, active, 0, &out);
- // Error so logs can be collected from end-users.
- LOG(ERROR) << out.str();
-}
-
void HandleRotateScreen() {
ScreenManager* screen_manager = ScreenManager::Get();
gfx::Display::Rotation current_rotation =
@@ -86,9 +39,7 @@ void HandleRotateScreen() {
} // namespace
-// static
-ScreenAcceleratorHandler::ScreenAcceleratorHandler(aura::Window* root_window)
- : root_window_(root_window) {
+ScreenAcceleratorHandler::ScreenAcceleratorHandler() {
AcceleratorManager::Get()->RegisterAccelerators(
accelerator_data, arraysize(accelerator_data), this);
}
@@ -104,12 +55,6 @@ bool ScreenAcceleratorHandler::OnAcceleratorFired(
int command_id,
const ui::Accelerator& accelerator) {
switch (command_id) {
- case CMD_PRINT_LAYER_HIERARCHY:
- PrintLayerHierarchy(root_window_);
- return true;
- case CMD_PRINT_WINDOW_HIERARCHY:
- HandlePrintWindowHierarchy(root_window_);
- return true;
case CMD_ROTATE_SCREEN:
HandleRotateScreen();
return true;
« no previous file with comments | « athena/screen/screen_accelerator_handler.h ('k') | athena/screen/screen_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698