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

Side by Side Diff: chrome/views/view.cc

Issue 13235: Cleanup adding BoundsInWidget to View to convert callers... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years 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
« chrome/views/view.h ('K') | « chrome/views/view.h ('k') | no next file » | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/views/view.h" 5 #include "chrome/views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #ifndef NDEBUG 9 #ifndef NDEBUG
10 #include <iostream> 10 #include <iostream>
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 // If the view is not connected to a tree, there's nothing we can do. 1326 // If the view is not connected to a tree, there's nothing we can do.
1327 Widget* widget = src->GetWidget(); 1327 Widget* widget = src->GetWidget();
1328 if (widget) { 1328 if (widget) {
1329 ConvertPointToWidget(src, p); 1329 ConvertPointToWidget(src, p);
1330 CRect r; 1330 CRect r;
1331 widget->GetBounds(&r, false); 1331 widget->GetBounds(&r, false);
1332 p->SetPoint(p->x() + r.left, p->y() + r.top); 1332 p->SetPoint(p->x() + r.left, p->y() + r.top);
1333 } 1333 }
1334 } 1334 }
1335 1335
1336 gfx::Rect View::BoundsInWidget() {
1337 gfx::Rect bounds_in_widget = bounds_;
1338 gfx::Point origin;
1339 ConvertPointToWidget(this, &origin);
1340 bounds_in_widget.set_origin(origin);
1341 return bounds_in_widget;
1342 }
1343
1336 ///////////////////////////////////////////////////////////////////////////// 1344 /////////////////////////////////////////////////////////////////////////////
1337 // 1345 //
1338 // View - event handlers 1346 // View - event handlers
1339 // 1347 //
1340 ///////////////////////////////////////////////////////////////////////////// 1348 /////////////////////////////////////////////////////////////////////////////
1341 1349
1342 bool View::OnMousePressed(const MouseEvent& e) { 1350 bool View::OnMousePressed(const MouseEvent& e) {
1343 return false; 1351 return false;
1344 } 1352 }
1345 1353
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 } 1657 }
1650 1658
1651 void View::DragInfo::PossibleDrag(int x, int y) { 1659 void View::DragInfo::PossibleDrag(int x, int y) {
1652 possible_drag = true; 1660 possible_drag = true;
1653 start_x = x; 1661 start_x = x;
1654 start_y = y; 1662 start_y = y;
1655 } 1663 }
1656 1664
1657 } // namespace 1665 } // namespace
1658 1666
OLDNEW
« chrome/views/view.h ('K') | « chrome/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698