| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ | 5 #ifndef ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ |
| 6 #define ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ | 6 #define ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
| 12 | 12 |
| 13 namespace aura { | 13 namespace aura { |
| 14 class Window; | 14 class Window; |
| 15 } // namespace aura | 15 } // namespace aura |
| 16 | 16 |
| 17 namespace views { | 17 namespace views { |
| 18 class Button; | 18 class Button; |
| 19 class Widget; | 19 class Widget; |
| 20 } // namespace views | 20 } // namespace views |
| 21 | 21 |
| 22 namespace ash { | 22 namespace ash { |
| 23 | 23 class TransparentButton; |
| 24 class TransparentActivateWindowButtonDelegate; | 24 class TransparentActivateWindowButtonDelegate; |
| 25 | 25 |
| 26 // Transparent window that covers window selector items and handles mouse and | 26 // Transparent window that covers window selector items and handles mouse and |
| 27 // gestures on overview mode for them. | 27 // gestures on overview mode for them. |
| 28 class TransparentActivateWindowButton { | 28 class TransparentActivateWindowButton { |
| 29 public: | 29 public: |
| 30 TransparentActivateWindowButton( | 30 TransparentActivateWindowButton( |
| 31 aura::Window* root_window, | 31 aura::Window* root_window, |
| 32 TransparentActivateWindowButtonDelegate* delegate); | 32 TransparentActivateWindowButtonDelegate* delegate); |
| 33 ~TransparentActivateWindowButton(); | 33 ~TransparentActivateWindowButton(); |
| 34 | 34 |
| 35 // Sets the accessibility name. | 35 // Sets the accessibility name. |
| 36 void SetAccessibleName(const base::string16& name); | 36 void SetAccessibleName(const base::string16& name); |
| 37 | 37 |
| 38 // Sets the bounds of the transparent window. | 38 // Sets the bounds of the transparent window. |
| 39 void SetBounds(const gfx::Rect& bounds); | 39 void SetBounds(const gfx::Rect& bounds); |
| 40 | 40 |
| 41 // Set the distance, in pixels, for which a drag gesture will cause a window |
| 42 // to be closed when the drag distance exceeds |distance|. |
| 43 void SetCloseWindowDistanceMinimum(int distance); |
| 44 |
| 41 // Sends an accessibility focus alert so that if chromevox is enabled, the | 45 // Sends an accessibility focus alert so that if chromevox is enabled, the |
| 42 // window title is read. | 46 // window title is read. |
| 43 void SendFocusAlert() const; | 47 void SendFocusAlert() const; |
| 44 | 48 |
| 45 // Stacks |this| above |activate_button| in the window z-ordering. | 49 // Stacks |this| above |activate_button| in the window z-ordering. |
| 46 void StackAbove(TransparentActivateWindowButton* activate_button); | 50 void StackAbove(TransparentActivateWindowButton* activate_button); |
| 47 | 51 |
| 48 private: | 52 private: |
| 49 // The transparent window event handler widget itself. | 53 // The transparent window event handler widget itself. |
| 50 scoped_ptr<views::Widget> event_handler_widget_; | 54 scoped_ptr<views::Widget> event_handler_widget_; |
| 51 | 55 |
| 52 // The transparent button view that handles user input. Not owned. | 56 // The transparent button view that handles user input. Not owned. |
| 53 views::Button* transparent_button_; | 57 TransparentButton* transparent_button_; |
| 54 | 58 |
| 55 DISALLOW_COPY_AND_ASSIGN(TransparentActivateWindowButton); | 59 DISALLOW_COPY_AND_ASSIGN(TransparentActivateWindowButton); |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 } // namespace ash | 62 } // namespace ash |
| 59 | 63 |
| 60 #endif // ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ | 64 #endif // ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ |
| OLD | NEW |