Chromium Code Reviews| Index: ash/sticky_keys/sticky_keys_overlay.h |
| diff --git a/ash/sticky_keys/sticky_keys_overlay.h b/ash/sticky_keys/sticky_keys_overlay.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c51956e610b6fa9e6117d4499eb5d424f2b6b654 |
| --- /dev/null |
| +++ b/ash/sticky_keys/sticky_keys_overlay.h |
| @@ -0,0 +1,58 @@ |
| +// 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 ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
| +#define ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
| + |
| +#include "ash/sticky_keys/sticky_keys_constants.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "ui/events/event_constants.h" |
| +#include "ui/gfx/animation/animation_delegate.h" |
| + |
| +namespace gfx { |
| +class Size; |
| +class SlideAnimation; |
| +} |
| + |
| +namespace views { |
| +class Widget; |
| +} |
| + |
| +namespace ash { |
| + |
| +class StickyKeysOverlayView; |
| + |
| +// Controls the overlay UI for sticky keys. |
|
James Cook
2014/01/14 00:59:03
nit: This comment could mention what the UI looks
Tim Song
2014/01/14 03:01:10
Done.
|
| +class StickyKeysOverlay : public gfx::AnimationDelegate { |
| + public: |
| + StickyKeysOverlay(); |
| + virtual ~StickyKeysOverlay(); |
| + |
| + // Shows or hides the overlay. |
| + void Show(bool visible); |
| + |
| + // Updates the overlay with the current state of a sticky key modifier. |
| + void SetModifierKeyState(StickyKeyModifier modifier, |
| + StickyKeyState state); |
| + |
| + private: |
| + // Returns the size of the overlay widget, which is based on its content |
| + // view. |
| + gfx::Size GetWidgetSize(); |
| + |
| + // gfx::AnimationDelegate overrides: |
| + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; |
| + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; |
| + |
| + bool is_showing_; |
| + scoped_ptr<views::Widget> overlay_widget_; |
| + scoped_ptr<gfx::Size> widget_size_; |
|
James Cook
2014/01/14 00:59:03
Why not just a member gfx::Size?
Tim Song
2014/01/14 03:01:10
Done. We may need support for resizing the overlay
|
| + StickyKeysOverlayView* overlay_view_; |
|
James Cook
2014/01/14 00:59:03
I presume this is not owned, might be nice to comm
Tim Song
2014/01/14 03:01:10
Done.
|
| + scoped_ptr<gfx::SlideAnimation> animation_; |
| +}; |
| + |
| +} // ash |
| + |
| +#endif //ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
|
James Cook
2014/01/14 00:59:03
nit: space after //
Tim Song
2014/01/14 03:01:10
Done.
|