diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-27 01:53:40 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-27 01:53:40 +0000 |
commit | 918f8db43032cb88114b7bcbdf137f94c4ac4e3e (patch) | |
tree | 8d4b8806288794f63d12855301c3cad138dd4e33 /ash/debug.cc | |
parent | 5f683172f6f64e33edcb664e30795808e989c38d (diff) | |
download | chromium_src-918f8db43032cb88114b7bcbdf137f94c4ac4e3e.zip chromium_src-918f8db43032cb88114b7bcbdf137f94c4ac4e3e.tar.gz chromium_src-918f8db43032cb88114b7bcbdf137f94c4ac4e3e.tar.bz2 |
Add debug shortcuts that toggles options to shows paint rects.
Cleanup: Separate desktop shortcuts which are useful only on linux desktop, and debug shortcuts.
BUG=227375
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195733
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195854
Review URL: https://chromiumcodereview.appspot.com/14050009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/debug.cc')
-rw-r--r-- | ash/debug.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ash/debug.cc b/ash/debug.cc new file mode 100644 index 0000000..ce2ca17 --- /dev/null +++ b/ash/debug.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/debug.h" + +#include "ash/shell.h" +#include "ui/aura/root_window.h" +#include "ui/compositor/compositor.h" + +namespace ash { +namespace debug { + +void ToggleShowPaintRects() { + Shell::RootWindowList root_windows = + Shell::GetInstance()->GetAllRootWindows(); + scoped_ptr<bool> value; + for (Shell::RootWindowList::iterator it = root_windows.begin(); + it != root_windows.end(); ++it) { + ui::Compositor* compositor = (*it)->compositor(); + if (!value.get()) + value.reset(new bool(!compositor->IsShowPaintRectsEnabled())); + compositor->SetShowPaintRectsEnabled(*value.get()); + } +} + +} // debug +} // ash |