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

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

Issue 1213193003: Remove DCHECK_IMPLIES and CHECK_IMPLIES (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « ui/views/touchui/touch_selection_menu_runner_views.cc ('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) 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 void View::Paint(const ui::PaintContext& parent_context) { 734 void View::Paint(const ui::PaintContext& parent_context) {
735 if (!visible_) 735 if (!visible_)
736 return; 736 return;
737 if (size().IsEmpty()) 737 if (size().IsEmpty())
738 return; 738 return;
739 739
740 gfx::Vector2d offset_to_parent; 740 gfx::Vector2d offset_to_parent;
741 if (!layer()) { 741 if (!layer()) {
742 // If the View has a layer() then it is a paint root. Otherwise, we need to 742 // If the View has a layer() then it is a paint root. Otherwise, we need to
743 // add the offset from the parent into the total offset from the paint root. 743 // add the offset from the parent into the total offset from the paint root.
744 DCHECK_IMPLIES(!parent(), bounds().origin() == gfx::Point()); 744 DCHECK(parent() || bounds().origin() == gfx::Point());
745 offset_to_parent = GetMirroredPosition().OffsetFromOrigin(); 745 offset_to_parent = GetMirroredPosition().OffsetFromOrigin();
746 } 746 }
747 ui::PaintContext context(parent_context, offset_to_parent); 747 ui::PaintContext context(parent_context, offset_to_parent);
748 748
749 bool is_invalidated = true; 749 bool is_invalidated = true;
750 if (context.CanCheckInvalid()) { 750 if (context.CanCheckInvalid()) {
751 #if DCHECK_IS_ON() 751 #if DCHECK_IS_ON()
752 gfx::Vector2d offset; 752 gfx::Vector2d offset;
753 context.Visited(this); 753 context.Visited(this);
754 View* view = this; 754 View* view = this;
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 // Message the RootView to do the drag and drop. That way if we're removed 2356 // Message the RootView to do the drag and drop. That way if we're removed
2357 // the RootView can detect it and avoid calling us back. 2357 // the RootView can detect it and avoid calling us back.
2358 gfx::Point widget_location(event.location()); 2358 gfx::Point widget_location(event.location());
2359 ConvertPointToWidget(this, &widget_location); 2359 ConvertPointToWidget(this, &widget_location);
2360 widget->RunShellDrag(this, data, widget_location, drag_operations, source); 2360 widget->RunShellDrag(this, data, widget_location, drag_operations, source);
2361 // WARNING: we may have been deleted. 2361 // WARNING: we may have been deleted.
2362 return true; 2362 return true;
2363 } 2363 }
2364 2364
2365 } // namespace views 2365 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/touchui/touch_selection_menu_runner_views.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698