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

Side by Side Diff: ui/gfx/rect.cc

Issue 8477019: Adds Window::MoveChildToFront, with surrounding changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/compositor/layer.cc ('k') | views/widget/native_widget_aura.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/rect.h" 5 #include "ui/gfx/rect.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #elif defined(OS_MACOSX) 9 #elif defined(OS_MACOSX)
10 #include <CoreGraphics/CGGeometry.h> 10 #include <CoreGraphics/CGGeometry.h>
11 #elif defined(TOOLKIT_USES_GTK) 11 #elif defined(TOOLKIT_USES_GTK)
12 #include <gdk/gdk.h> 12 #include <gdk/gdk.h>
13 #endif 13 #endif
14 #if defined(USE_WAYLAND) 14 #if defined(USE_WAYLAND)
15 #include <cairo.h> 15 #include <cairo.h>
16 #endif 16 #endif
17 17
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/stringprintf.h" 19 #include "base/stringprintf.h"
20 #include "ui/gfx/insets.h" 20 #include "ui/gfx/insets.h"
21 21
22 namespace { 22 namespace {
23 23
24 void AdjustAlongAxis(int dst_origin, int dst_size, int* origin, int* size) { 24 void AdjustAlongAxis(int dst_origin, int dst_size, int* origin, int* size) {
25 if (*origin < dst_origin) { 25 *size = std::min(dst_size, *size);
26 if (*origin < dst_origin)
26 *origin = dst_origin; 27 *origin = dst_origin;
27 *size = std::min(dst_size, *size); 28 else
28 } else {
29 *size = std::min(dst_size, *size);
30 *origin = std::min(dst_origin + dst_size, *origin + *size) - *size; 29 *origin = std::min(dst_origin + dst_size, *origin + *size) - *size;
31 }
32 } 30 }
33 31
34 } // namespace 32 } // namespace
35 33
36 namespace gfx { 34 namespace gfx {
37 35
38 Rect::Rect() { 36 Rect::Rect() {
39 } 37 }
40 38
41 Rect::Rect(int width, int height) 39 Rect::Rect(int width, int height)
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 (y() == rect.bottom() || bottom() == rect.y())); 283 (y() == rect.bottom() || bottom() == rect.y()));
286 } 284 }
287 285
288 std::string Rect::ToString() const { 286 std::string Rect::ToString() const {
289 return base::StringPrintf("%s %s", 287 return base::StringPrintf("%s %s",
290 origin_.ToString().c_str(), 288 origin_.ToString().c_str(),
291 size_.ToString().c_str()); 289 size_.ToString().c_str());
292 } 290 }
293 291
294 } // namespace gfx 292 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/compositor/layer.cc ('k') | views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698