Chromium Code Reviews| 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 explicit OverviewWindowButton(aura::Window* target); | |
|
flackr
2015/01/23 19:31:55
nit: brief description. I.e. what is |target|.
Nina
2015/01/23 20:35:54
Done.
| |
| 24 | |
| 25 ~OverviewWindowButton() override; | |
| 26 | |
| 27 // Sets the label and targetable bounds. | |
| 28 void SetBounds(const gfx::Rect& bounds, | |
| 29 const OverviewAnimationType& animation_type); | |
| 30 | |
| 31 // Sends an a11y focus alert so that, if chromevox is enabled, the window | |
| 32 // label is read. | |
| 33 void SendFocusAlert() const; | |
| 34 | |
| 35 // Sets the label text. | |
| 36 void SetLabelText(const base::string16& title); | |
| 37 | |
| 38 // Sets the label opacity. | |
| 39 void SetOpacity(float opacity); | |
| 40 | |
| 41 // views::ButtonListener | |
| 42 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
| 43 | |
| 44 private: | |
| 45 friend class WindowSelectorTest; | |
| 46 | |
| 47 // LabelButton shown under each of the windows. | |
| 48 class OverviewButtonView; | |
| 49 | |
| 50 // Window that the button will activate on click. | |
| 51 aura::Window* target_; | |
| 52 | |
| 53 // Label under the window displaying its active tab name. | |
| 54 scoped_ptr<views::Widget> window_label_; | |
| 55 | |
| 56 // View for the label button under the window. | |
| 57 OverviewButtonView* window_label_button_view_; | |
| 58 | |
| 59 // Reference to the targeter implemented by the scoped window targeter. | |
| 60 OverviewWindowTargeter* overview_window_targeter_; | |
| 61 | |
| 62 // Stores and restores on exit the actual window targeter. | |
| 63 scoped_ptr<aura::ScopedWindowTargeter> scoped_window_targeter_; | |
| 64 | |
| 65 DISALLOW_COPY_AND_ASSIGN(OverviewWindowButton); | |
| 66 }; | |
| 67 | |
| 68 } // namespace ash | |
| 69 | |
| 70 #endif // ASH_WM_OVERVIEW_OVERVIEW_WINDOW_BUTTON_H_ | |
| OLD | NEW |