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

Unified Diff: ui/views/masked_view_targeter.cc

Issue 339713005: Remove MaskedViewTargeter and its derived classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/views/masked_view_targeter.h ('k') | ui/views/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/masked_view_targeter.cc
diff --git a/ui/views/masked_view_targeter.cc b/ui/views/masked_view_targeter.cc
deleted file mode 100644
index 112df676808c4d2759388657c6f484fc71fe53bf..0000000000000000000000000000000000000000
--- a/ui/views/masked_view_targeter.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 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/views/masked_view_targeter.h"
-
-#include "ui/gfx/path.h"
-#include "ui/gfx/skia_util.h"
-#include "ui/views/view.h"
-
-namespace views {
-
-MaskedViewTargeter::MaskedViewTargeter(View* masked_view)
- : masked_view_(masked_view) {
-}
-
-MaskedViewTargeter::~MaskedViewTargeter() {
-}
-
-bool MaskedViewTargeter::EventLocationInsideBounds(
- ui::EventTarget* target,
- const ui::LocatedEvent& event) const {
- View* view = static_cast<View*>(target);
- if (view == masked_view_) {
- gfx::Path mask;
- if (!GetHitTestMask(view, &mask))
- return ViewTargeter::EventLocationInsideBounds(view, event);
-
- gfx::Size size = view->bounds().size();
- SkRegion clip_region;
- clip_region.setRect(0, 0, size.width(), size.height());
-
- gfx::RectF bounds_f = ViewTargeter::BoundsForEvent(event);
- if (view->parent())
- View::ConvertRectToTarget(view->parent(), view, &bounds_f);
- gfx::Rect bounds = gfx::ToEnclosingRect(bounds_f);
-
- SkRegion mask_region;
- return mask_region.setPath(mask, clip_region) &&
- mask_region.intersects(RectToSkIRect(bounds));
- }
-
- return ViewTargeter::EventLocationInsideBounds(view, event);
-}
-
-} // namespace views
« no previous file with comments | « ui/views/masked_view_targeter.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698