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

Unified Diff: ui/base/range/range_mac.mm

Issue 24012002: Move Range code to gfx. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: d Created 7 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/base/range/range.cc ('k') | ui/base/range/range_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/range/range_mac.mm
diff --git a/ui/base/range/range_mac.mm b/ui/base/range/range_mac.mm
deleted file mode 100644
index e99db374c9029d84939b32a44a5aac62c5412bf6..0000000000000000000000000000000000000000
--- a/ui/base/range/range_mac.mm
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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.
-
-#include "ui/base/range/range.h"
-
-#include <limits>
-
-#include "base/logging.h"
-
-namespace ui {
-
-Range::Range(const NSRange& range) {
- *this = range;
-}
-
-Range& Range::operator=(const NSRange& range) {
- if (range.location == NSNotFound) {
- DCHECK_EQ(0U, range.length);
- *this = InvalidRange();
- } else {
- set_start(range.location);
- // Don't overflow |end_|.
- DCHECK_LE(range.length, std::numeric_limits<size_t>::max() - start());
- set_end(start() + range.length);
- }
- return *this;
-}
-
-NSRange Range::ToNSRange() const {
- if (!IsValid())
- return NSMakeRange(NSNotFound, 0);
- return NSMakeRange(GetMin(), length());
-}
-
-} // namespace gfx
« no previous file with comments | « ui/base/range/range.cc ('k') | ui/base/range/range_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698