OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
6 | 6 |
7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 gfx::Rect contents_bounds(GetLocalBounds()); | 320 gfx::Rect contents_bounds(GetLocalBounds()); |
321 if (border_.get()) | 321 if (border_.get()) |
322 contents_bounds.Inset(border_->GetInsets()); | 322 contents_bounds.Inset(border_->GetInsets()); |
323 return contents_bounds; | 323 return contents_bounds; |
324 } | 324 } |
325 | 325 |
326 gfx::Rect View::GetLocalBounds() const { | 326 gfx::Rect View::GetLocalBounds() const { |
327 return gfx::Rect(size()); | 327 return gfx::Rect(size()); |
328 } | 328 } |
329 | 329 |
330 gfx::Rect View::GetLayerBoundsInPixel() const { | |
331 return layer()->GetTargetBounds(); | |
332 } | |
333 | |
334 gfx::Insets View::GetInsets() const { | 330 gfx::Insets View::GetInsets() const { |
335 return border_.get() ? border_->GetInsets() : gfx::Insets(); | 331 return border_.get() ? border_->GetInsets() : gfx::Insets(); |
336 } | 332 } |
337 | 333 |
338 gfx::Rect View::GetVisibleBounds() const { | 334 gfx::Rect View::GetVisibleBounds() const { |
339 if (!IsDrawn()) | 335 if (!IsDrawn()) |
340 return gfx::Rect(); | 336 return gfx::Rect(); |
341 gfx::Rect vis_bounds(GetLocalBounds()); | 337 gfx::Rect vis_bounds(GetLocalBounds()); |
342 gfx::Rect ancestor_bounds; | 338 gfx::Rect ancestor_bounds; |
343 const View* view = this; | 339 const View* view = this; |
(...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 // Message the RootView to do the drag and drop. That way if we're removed | 2424 // Message the RootView to do the drag and drop. That way if we're removed |
2429 // the RootView can detect it and avoid calling us back. | 2425 // the RootView can detect it and avoid calling us back. |
2430 gfx::Point widget_location(event.location()); | 2426 gfx::Point widget_location(event.location()); |
2431 ConvertPointToWidget(this, &widget_location); | 2427 ConvertPointToWidget(this, &widget_location); |
2432 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2428 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2433 // WARNING: we may have been deleted. | 2429 // WARNING: we may have been deleted. |
2434 return true; | 2430 return true; |
2435 } | 2431 } |
2436 | 2432 |
2437 } // namespace views | 2433 } // namespace views |
OLD | NEW |