| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_WM_OVERVIEW_OVERVIEW_WINDOW_BUTTON_H_ | |
| 6 #define ASH_WM_OVERVIEW_OVERVIEW_WINDOW_BUTTON_H_ | |
| 7 | |
| 8 #include "ash/wm/overview/scoped_transform_overview_window.h" | |
| 9 #include "ui/views/controls/button/button.h" | |
| 10 | |
| 11 namespace aura { | |
| 12 class ScopedWindowTargeter; | |
| 13 } | |
| 14 | |
| 15 namespace ash { | |
| 16 | |
| 17 class OverviewWindowTargeter; | |
| 18 | |
| 19 // A class that encapsulates the LabelButton and targeting logic for overview | |
| 20 // mode. | |
| 21 class OverviewWindowButton : public views::ButtonListener { | |
| 22 public: | |
| 23 // |target| is the window that should be activated when the button is pressed. | |
| 24 explicit OverviewWindowButton(aura::Window* target); | |
| 25 | |
| 26 ~OverviewWindowButton() override; | |
| 27 | |
| 28 // Sets the label and targetable bounds. | |
| 29 void SetBounds(const gfx::Rect& bounds, | |
| 30 const OverviewAnimationType& animation_type); | |
| 31 | |
| 32 // Sends an a11y focus alert so that, if chromevox is enabled, the window | |
| 33 // label is read. | |
| 34 void SendFocusAlert() const; | |
| 35 | |
| 36 // Sets the label text. | |
| 37 void SetLabelText(const base::string16& title); | |
| 38 | |
| 39 // Sets the label opacity. | |
| 40 void SetOpacity(float opacity); | |
| 41 | |
| 42 // views::ButtonListener | |
| 43 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
| 44 | |
| 45 private: | |
| 46 friend class WindowSelectorTest; | |
| 47 | |
| 48 // LabelButton shown under each of the windows. | |
| 49 class OverviewButtonView; | |
| 50 | |
| 51 // Window that the button will activate on click. | |
| 52 aura::Window* target_; | |
| 53 | |
| 54 // Label under the window displaying its active tab name. | |
| 55 scoped_ptr<views::Widget> window_label_; | |
| 56 | |
| 57 // View for the label button under the window. | |
| 58 OverviewButtonView* window_label_button_view_; | |
| 59 | |
| 60 // Reference to the targeter implemented by the scoped window targeter. | |
| 61 OverviewWindowTargeter* overview_window_targeter_; | |
| 62 | |
| 63 // Stores and restores on exit the actual window targeter. | |
| 64 scoped_ptr<aura::ScopedWindowTargeter> scoped_window_targeter_; | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(OverviewWindowButton); | |
| 67 }; | |
| 68 | |
| 69 } // namespace ash | |
| 70 | |
| 71 #endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_BUTTON_H_ | |
| OLD | NEW |