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

Unified Diff: ui/views/debug_utils.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 | « ui/views/debug_utils.h ('k') | ui/views/drag_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/debug_utils.cc
diff --git a/ui/views/debug_utils.cc b/ui/views/debug_utils.cc
deleted file mode 100644
index 12b4759b33dc613ba5492879ea3b323ea6287cc1..0000000000000000000000000000000000000000
--- a/ui/views/debug_utils.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 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 "ui/views/debug_utils.h"
-
-#include <ostream>
-
-#include "base/logging.h"
-#include "base/strings/utf_string_conversions.h"
-#include "ui/views/view.h"
-
-namespace views {
-namespace {
-void PrintViewHierarchyImp(const View* view,
- int indent,
- std::wostringstream* out) {
- int ind = indent;
- while (ind-- > 0)
- *out << L' ';
- *out << base::UTF8ToWide(view->GetClassName());
- *out << L' ';
- *out << view->id();
- *out << L' ';
- *out << view->x() << L"," << view->y() << L",";
- *out << view->bounds().right() << L"," << view->bounds().bottom();
- *out << L' ';
- *out << view;
- *out << L'\n';
-
- for (int i = 0, count = view->child_count(); i < count; ++i)
- PrintViewHierarchyImp(view->child_at(i), indent + 2, out);
-}
-
-void PrintFocusHierarchyImp(const View* view,
- int indent,
- std::wostringstream* out) {
- int ind = indent;
- while (ind-- > 0)
- *out << L' ';
- *out << base::UTF8ToWide(view->GetClassName());
- *out << L' ';
- *out << view->id();
- *out << L' ';
- *out << view->GetClassName();
- *out << L' ';
- *out << view;
- *out << L'\n';
-
- if (view->child_count() > 0)
- PrintFocusHierarchyImp(view->child_at(0), indent + 2, out);
-
- const View* next_focusable = view->GetNextFocusableView();
- if (next_focusable)
- PrintFocusHierarchyImp(next_focusable, indent, out);
-}
-} // namespace
-
-void PrintViewHierarchy(const View* view) {
- std::wostringstream out;
- out << L"View hierarchy:\n";
- PrintViewHierarchyImp(view, 0, &out);
- // Error so users in the field can generate and upload logs.
- LOG(ERROR) << out.str();
-}
-
-void PrintFocusHierarchy(const View* view) {
- std::wostringstream out;
- out << L"Focus hierarchy:\n";
- PrintFocusHierarchyImp(view, 0, &out);
- // Error so users in the field can generate and upload logs.
- LOG(ERROR) << out.str();
-}
-
-} // namespace views
« no previous file with comments | « ui/views/debug_utils.h ('k') | ui/views/drag_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698