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

Unified Diff: ui/gfx/size.cc

Issue 8038024: ui/gfx: Add ToString() function to Size class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/gfx/size.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/size.cc
diff --git a/ui/gfx/size.cc b/ui/gfx/size.cc
index 6b72aedec7449895dca1ec2371b50745eb9a8c25..2723b6c20a7df94e1232e441678c99736f92c055 100644
--- a/ui/gfx/size.cc
+++ b/ui/gfx/size.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -10,12 +10,13 @@
#include <CoreGraphics/CGGeometry.h>
#endif
-#include <ostream>
-
#include "base/logging.h"
+#include "base/stringprintf.h"
namespace gfx {
+Size::Size() : width_(0), height_(0) {}
+
Size::Size(int width, int height) {
set_width(width);
set_height(height);
@@ -63,8 +64,8 @@ void Size::set_height(int height) {
height_ = height;
}
-std::ostream& operator<<(std::ostream& out, const gfx::Size& s) {
- return out << s.width() << "x" << s.height();
+std::string Size::ToString() const {
+ return base::StringPrintf("%dx%d", width_, height_);
}
} // namespace gfx
« no previous file with comments | « ui/gfx/size.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698