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

Side by Side Diff: ash/wm/overview/transparent_activate_window_button.h

Issue 690103008: Implemented swipe to close in overview mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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 "ui/views/controls/button/button.h" 9 #include "ui/views/controls/button/button.h"
10 10
11 namespace ash { 11 namespace ash {
12 class TransparentButton; 12 class TransparentButton;
13 class TransparentActivateWindowButtonDelegate; 13 class TransparentActivateWindowButtonDelegate;
14 14
15 // Transparent window that covers window selector items and handles mouse and 15 // Transparent window that covers window selector items and handles mouse and
16 // gestures on overview mode for them. 16 // gestures on overview mode for them.
17 class TransparentActivateWindowButton : public views::ButtonListener { 17 class TransparentActivateWindowButton : public views::ButtonListener {
18 public: 18 public:
19 TransparentActivateWindowButton( 19 TransparentActivateWindowButton(
20 aura::Window* root_window, 20 aura::Window* root_window,
21 TransparentActivateWindowButtonDelegate* delegate); 21 TransparentActivateWindowButtonDelegate* delegate);
22 virtual ~TransparentActivateWindowButton(); 22 virtual ~TransparentActivateWindowButton();
23 23
24 // Sets the accessibility name. 24 // Sets the accessibility name.
25 void SetAccessibleName(const base::string16& name); 25 void SetAccessibleName(const base::string16& name);
26 26
27 // Sets the bounds of the transparent window. 27 // Sets the bounds of the transparent window.
28 void SetBounds(const gfx::Rect& bounds); 28 void SetBounds(const gfx::Rect& bounds);
29 29
30 // Set the distance, in pixels, for which a drag gesture will cause a window
31 // to be closed when the drag distance exceeds |distance|.
32 void SetCloseWindowDistanceMinimum(int distance);
33
30 // Sends an accessibility focus alert so that if chromevox is enabled, the 34 // Sends an accessibility focus alert so that if chromevox is enabled, the
31 // window title is read. 35 // window title is read.
32 void SendFocusAlert() const; 36 void SendFocusAlert() const;
33 37
34 // Stacks the transparent overlay at the bottom of the z-order. 38 // Stacks the transparent overlay at the bottom of the z-order.
35 void StackAtBottom(); 39 void StackAtBottom();
36 40
37 // views::ButtonListener: 41 // views::ButtonListener:
38 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 42 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
39 43
40 private: 44 private:
41 // The transparent window event handler widget itself. 45 // The transparent window event handler widget itself.
42 scoped_ptr<views::Widget> event_handler_widget_; 46 scoped_ptr<views::Widget> event_handler_widget_;
43 47
44 // The transparent button view that handles user input. Not owned. 48 // The transparent button view that handles user input. Not owned.
45 TransparentButton* transparent_button_; 49 TransparentButton* transparent_button_;
46 50
47 DISALLOW_COPY_AND_ASSIGN(TransparentActivateWindowButton); 51 DISALLOW_COPY_AND_ASSIGN(TransparentActivateWindowButton);
48 }; 52 };
49 53
50 } // namespace ash 54 } // namespace ash
51 55
52 #endif // ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_ 56 #endif // ASH_WM_OVERVIEW_TRANSPARENT_ACTIVATE_WINDOW_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698