diff options
author | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 22:54:17 +0000 |
---|---|---|
committer | dmichael@chromium.org <dmichael@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 22:54:17 +0000 |
commit | 1bb2aa70728ab0b8917b9c44284bd22f591b1ea0 (patch) | |
tree | 3d1c20241b5236a9e6911f1ef01629268259a201 /ui/wm/public | |
parent | 78887cf9abd2a730fe4a784ddfe3251929717cc3 (diff) | |
download | chromium_src-1bb2aa70728ab0b8917b9c44284bd22f591b1ea0.zip chromium_src-1bb2aa70728ab0b8917b9c44284bd22f591b1ea0.tar.gz chromium_src-1bb2aa70728ab0b8917b9c44284bd22f591b1ea0.tar.bz2 |
Revert "Move wm/core to wm namespace."
This reverts commit 067d7fe616a07011b9e2d2609fc65af8db6a7dfb.
Broke the build:
http://build.chromium.org/p/chromium.mac/builders/Mac%20Builder%20%28dbg%29/builds/63598/steps/compile/logs/stdio
BUG=
TBR=ben
Review URL: https://codereview.chromium.org/198283002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/wm/public')
-rw-r--r-- | ui/wm/public/easy_resize_window_targeter.h | 52 | ||||
-rw-r--r-- | ui/wm/public/masked_window_targeter.h | 39 |
2 files changed, 91 insertions, 0 deletions
diff --git a/ui/wm/public/easy_resize_window_targeter.h b/ui/wm/public/easy_resize_window_targeter.h new file mode 100644 index 0000000..f873509 --- /dev/null +++ b/ui/wm/public/easy_resize_window_targeter.h @@ -0,0 +1,52 @@ +// 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. + +#ifndef UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_ +#define UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_ + +#include "ui/aura/window_targeter.h" +#include "ui/gfx/geometry/insets.h" + +namespace wm { + +// An EventTargeter for a container window that uses a slightly larger +// hit-target region for easier resize. +class EasyResizeWindowTargeter : public aura::WindowTargeter { + public: + // |container| window is the owner of this targeter. + EasyResizeWindowTargeter(aura::Window* container, + const gfx::Insets& mouse_extend, + const gfx::Insets& touch_extend); + + virtual ~EasyResizeWindowTargeter(); + + protected: + void set_mouse_extend(const gfx::Insets& mouse_extend) { + mouse_extend_ = mouse_extend; + } + + void set_touch_extend(const gfx::Insets& touch_extend) { + touch_extend_ = touch_extend; + } + + // aura::WindowTargeter: + virtual bool EventLocationInsideBounds( + aura::Window* window, + const ui::LocatedEvent& event) const OVERRIDE; + + private: + // Returns true if the hit testing (EventLocationInsideBounds()) should use + // the extended bounds. + bool ShouldUseExtendedBounds(const aura::Window* window) const; + + aura::Window* container_; + gfx::Insets mouse_extend_; + gfx::Insets touch_extend_; + + DISALLOW_COPY_AND_ASSIGN(EasyResizeWindowTargeter); +}; + +} // namespace wm + +#endif // UI_WM_PUBLIC_EASY_RESIZE_WINDOW_TARGETER_H_ diff --git a/ui/wm/public/masked_window_targeter.h b/ui/wm/public/masked_window_targeter.h new file mode 100644 index 0000000..ad3140d3 --- /dev/null +++ b/ui/wm/public/masked_window_targeter.h @@ -0,0 +1,39 @@ +// 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. + +#ifndef UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_ +#define UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_ + +#include "ui/aura/window_targeter.h" + +namespace gfx { +class Path; +} + +namespace wm { + +class MaskedWindowTargeter : public aura::WindowTargeter { + public: + explicit MaskedWindowTargeter(aura::Window* masked_window); + virtual ~MaskedWindowTargeter(); + + protected: + // Sets the hit-test mask for |window| in |mask| (in |window|'s local + // coordinate system). Returns whether a valid mask has been set in |mask|. + virtual bool GetHitTestMask(aura::Window* window, gfx::Path* mask) const = 0; + + // aura::WindowTargeter: + virtual bool EventLocationInsideBounds( + aura::Window* window, + const ui::LocatedEvent& event) const OVERRIDE; + + private: + aura::Window* masked_window_; + + DISALLOW_COPY_AND_ASSIGN(MaskedWindowTargeter); +}; + +} // namespace wm + +#endif // UI_WM_PUBLIC_MASKED_WINDOW_TARGETER_H_ |