summaryrefslogtreecommitdiffstats
path: root/ui/base
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 20:53:08 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-17 20:53:08 +0000
commit9a55b8c9af871b1e58b7f4f367b7c26fc53ab543 (patch)
tree11f261c89f79392fd66f3357aa924f4d9d4c116d /ui/base
parentd94b1c828da3dbc06a81fdf7479f6428f0b0dcfb (diff)
downloadchromium_src-9a55b8c9af871b1e58b7f4f367b7c26fc53ab543.zip
chromium_src-9a55b8c9af871b1e58b7f4f367b7c26fc53ab543.tar.gz
chromium_src-9a55b8c9af871b1e58b7f4f367b7c26fc53ab543.tar.bz2
Fix logging of string16s from gfx namespace on Windows.
I don't why this fixes it, but somehow having a SelectionModel << logging operator in the gfx namespace makes Visual Studio fail to find the << logging operator for string16 arguments. Per discussion with Scott, we decided to remove the << operators altogether and replace them with a ToString() function to be consistent with Rect, Size, etc. TEST=Check that adding a "LOG(INFO) << text();" line to RenderTextWin compiles. Review URL: https://chromiumcodereview.appspot.com/10332205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137732 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r--ui/base/range/range.cc9
-rw-r--r--ui/base/range/range.h8
2 files changed, 9 insertions, 8 deletions
diff --git a/ui/base/range/range.cc b/ui/base/range/range.cc
index 53223d2..b426a56 100644
--- a/ui/base/range/range.cc
+++ b/ui/base/range/range.cc
@@ -1,13 +1,14 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// 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/base/range/range.h"
#include <limits>
-#include <ostream>
+#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/stringprintf.h"
namespace ui {
@@ -75,8 +76,8 @@ Range Range::Intersect(const Range& range) const {
return Range(min, max);
}
-std::ostream& operator<<(std::ostream& out, const ui::Range& range) {
- return out << "{" << range.start() << "," << range.end() << "}";
+std::string Range::ToString() const {
+ return base::StringPrintf("{%" PRIuS ",%" PRIuS "}", start(), end());
}
} // namespace gfx
diff --git a/ui/base/range/range.h b/ui/base/range/range.h
index a86233d..018a11c 100644
--- a/ui/base/range/range.h
+++ b/ui/base/range/range.h
@@ -6,7 +6,7 @@
#define UI_BASE_RANGE_RANGE_H_
#pragma once
-#include <iosfwd>
+#include <string>
#include "base/basictypes.h"
#include "ui/base/ui_export.h"
@@ -103,13 +103,13 @@ class UI_EXPORT Range {
#endif
// GTK+ has no concept of a range.
+ std::string ToString() const;
+
private:
size_t start_;
size_t end_;
};
-UI_EXPORT std::ostream& operator<<(std::ostream& out, const ui::Range& range);
-
-} // namespace gfx
+} // namespace ui
#endif // UI_BASE_RANGE_RANGE_H_