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

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

Issue 251103005: Added arrow key navigation to Overview Mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replaced unittest by a better one, fixed lints, minor tweaks. Created 6 years, 6 months 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 #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
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 = new TransparentButton(this);
57 transparent_button->SetAccessibleName(activate_window->title());
57 event_handler_widget_->SetContentsView(transparent_button); 58 event_handler_widget_->SetContentsView(transparent_button);
58 } 59 }
59 60
60 void TransparentActivateWindowButton::SetBounds(const gfx::Rect& bounds) { 61 void TransparentActivateWindowButton::SetBounds(const gfx::Rect& bounds) {
61 event_handler_widget_->SetBounds(bounds); 62 event_handler_widget_->SetBounds(bounds);
62 } 63 }
63 64
65 void TransparentActivateWindowButton::SendFocusAlert() const {
66 event_handler_widget_->GetContentsView()->
67 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, true);
68 }
69
64 TransparentActivateWindowButton::~TransparentActivateWindowButton() { 70 TransparentActivateWindowButton::~TransparentActivateWindowButton() {
65 } 71 }
66 72
67 void TransparentActivateWindowButton::ButtonPressed(views::Button* sender, 73 void TransparentActivateWindowButton::ButtonPressed(views::Button* sender,
68 const ui::Event& event) { 74 const ui::Event& event) {
69 wm::GetWindowState(activate_window_)->Activate(); 75 wm::GetWindowState(activate_window_)->Activate();
70 } 76 }
71 77
72 } // namespace ash 78 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698