Get foreground tab on Android
[chromium-blink-merge.git] / ui / oak / oak_pretty_print.cc
blob0fb7dd41e4b33804528be6701d8a1c8f181fadf9
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/oak/oak_pretty_print.h"
7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h"
11 #include "ui/gfx/insets.h"
12 #include "ui/gfx/rect.h"
14 namespace oak {
15 namespace internal {
17 base::string16 PropertyWithInteger(const std::string& prefix, int value) {
18 return ASCIIToUTF16(prefix) + base::IntToString16(value);
21 base::string16 PropertyWithVoidStar(const std::string& prefix, void* ptr) {
22 unsigned int cast_ptr =
23 static_cast<unsigned int>(reinterpret_cast<intptr_t>(ptr));
24 return ASCIIToUTF16(
25 prefix + "0x" + (ptr ? base::StringPrintf("%x", cast_ptr) : "0"));
28 base::string16 PropertyWithBool(const std::string& prefix, bool value) {
29 return ASCIIToUTF16(prefix + (value ? "true" : "false"));
32 base::string16 PropertyWithBounds(const std::string& prefix,
33 const gfx::Rect& bounds) {
34 return ASCIIToUTF16(prefix + bounds.ToString());
37 base::string16 PropertyWithInsets(const std::string& prefix,
38 const gfx::Insets& insets) {
39 return ASCIIToUTF16(prefix + insets.ToString());
42 } // namespace internal
43 } // namespace oak