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

Unified Diff: ui/wm/core/easy_resize_window_targeter.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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/wm/core/easy_resize_window_targeter.h ('k') | ui/wm/core/focus_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/easy_resize_window_targeter.cc
diff --git a/ui/wm/core/easy_resize_window_targeter.cc b/ui/wm/core/easy_resize_window_targeter.cc
deleted file mode 100644
index 445028cbf921a1d5d2a742ff4f553439ab26cd34..0000000000000000000000000000000000000000
--- a/ui/wm/core/easy_resize_window_targeter.cc
+++ /dev/null
@@ -1,62 +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/wm/core/easy_resize_window_targeter.h"
-
-#include "ui/aura/window.h"
-#include "ui/gfx/geometry/insets_f.h"
-#include "ui/gfx/geometry/rect.h"
-#include "ui/wm/public/transient_window_client.h"
-
-namespace wm {
-
-EasyResizeWindowTargeter::EasyResizeWindowTargeter(
- aura::Window* container,
- const gfx::Insets& mouse_extend,
- const gfx::Insets& touch_extend)
- : container_(container),
- mouse_extend_(mouse_extend),
- touch_extend_(touch_extend) {
-}
-
-EasyResizeWindowTargeter::~EasyResizeWindowTargeter() {
-}
-
-bool EasyResizeWindowTargeter::EventLocationInsideBounds(
- ui::EventTarget* target,
- const ui::LocatedEvent& event) const {
- aura::Window* window = static_cast<aura::Window*>(target);
- if (ShouldUseExtendedBounds(window)) {
- // Note that |event|'s location is in |window|'s parent's coordinate system,
- // so convert it to |window|'s coordinate system first.
- gfx::Point point = event.location();
- if (window->parent())
- aura::Window::ConvertPointToTarget(window->parent(), window, &point);
-
- gfx::Rect bounds(window->bounds().size());
- if (event.IsTouchEvent() || event.IsGestureEvent())
- bounds.Inset(touch_extend_);
- else
- bounds.Inset(mouse_extend_);
-
- return bounds.Contains(point);
- }
- return WindowTargeter::EventLocationInsideBounds(window, event);
-}
-
-bool EasyResizeWindowTargeter::ShouldUseExtendedBounds(
- const aura::Window* window) const {
- // Use the extended bounds only for immediate child windows of |container_|.
- // Use the default targetter otherwise.
- if (window->parent() != container_)
- return false;
-
- aura::client::TransientWindowClient* transient_window_client =
- aura::client::GetTransientWindowClient();
- return !transient_window_client ||
- !transient_window_client->GetTransientParent(window) ||
- transient_window_client->GetTransientParent(window) == container_;
-}
-
-} // namespace wm
« no previous file with comments | « ui/wm/core/easy_resize_window_targeter.h ('k') | ui/wm/core/focus_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698