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 #include "ash/wm/overview/transparent_activate_window_button.h" | 5 #include "ash/wm/overview/transparent_activate_window_button.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
10 #include "ui/views/controls/button/custom_button.h" | 10 #include "ui/views/controls/button/custom_button.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 return widget; | 47 return widget; |
48 } | 48 } |
49 | 49 |
50 } // namespace | 50 } // namespace |
51 | 51 |
52 TransparentActivateWindowButton::TransparentActivateWindowButton( | 52 TransparentActivateWindowButton::TransparentActivateWindowButton( |
53 aura::Window* activate_window) | 53 aura::Window* activate_window) |
54 : event_handler_widget_(InitEventHandler(activate_window->GetRootWindow())), | 54 : event_handler_widget_(InitEventHandler(activate_window->GetRootWindow())), |
55 activate_window_(activate_window) { | 55 activate_window_(activate_window) { |
56 views::View* transparent_button = new TransparentButton(this); | 56 views::Button* transparent_button = |
| 57 new TransparentButton(this); |
| 58 transparent_button->SetAccessibleName(activate_window->title()); |
57 event_handler_widget_->SetContentsView(transparent_button); | 59 event_handler_widget_->SetContentsView(transparent_button); |
58 } | 60 } |
59 | 61 |
60 void TransparentActivateWindowButton::SetBounds(const gfx::Rect& bounds) { | 62 void TransparentActivateWindowButton::SetBounds(const gfx::Rect& bounds) { |
61 event_handler_widget_->SetBounds(bounds); | 63 event_handler_widget_->SetBounds(bounds); |
62 } | 64 } |
63 | 65 |
| 66 void TransparentActivateWindowButton::SendFocusAlert() const { |
| 67 event_handler_widget_->GetContentsView()-> |
| 68 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true); |
| 69 } |
| 70 |
64 TransparentActivateWindowButton::~TransparentActivateWindowButton() { | 71 TransparentActivateWindowButton::~TransparentActivateWindowButton() { |
65 } | 72 } |
66 | 73 |
67 void TransparentActivateWindowButton::ButtonPressed(views::Button* sender, | 74 void TransparentActivateWindowButton::ButtonPressed(views::Button* sender, |
68 const ui::Event& event) { | 75 const ui::Event& event) { |
69 wm::GetWindowState(activate_window_)->Activate(); | 76 wm::GetWindowState(activate_window_)->Activate(); |
70 } | 77 } |
71 | 78 |
72 } // namespace ash | 79 } // namespace ash |
OLD | NEW |