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

Side by Side Diff: chrome/browser/chromeos/ui/focus_ring_controller.cc

Issue 2038093003: Refactor accessible focus ring code so the layers are animation observers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@improve_highlights
Patch Set: Created 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/ui/focus_ring_controller.h" 5 #include "chrome/browser/chromeos/ui/focus_ring_controller.h"
6 6
7 #include "ash/system/tray/actionable_view.h" 7 #include "ash/system/tray/actionable_view.h"
8 #include "ash/system/tray/tray_background_view.h" 8 #include "ash/system/tray/tray_background_view.h"
9 #include "ash/system/tray/tray_popup_header_button.h" 9 #include "ash/system/tray/tray_popup_header_button.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // Update the focus ring layer. 91 // Update the focus ring layer.
92 if (!focus_ring_layer_) 92 if (!focus_ring_layer_)
93 focus_ring_layer_.reset(new FocusRingLayer(this)); 93 focus_ring_layer_.reset(new FocusRingLayer(this));
94 focus_ring_layer_->Set(root_window, view_bounds); 94 focus_ring_layer_->Set(root_window, view_bounds);
95 } 95 }
96 96
97 void FocusRingController::OnDeviceScaleFactorChanged() { 97 void FocusRingController::OnDeviceScaleFactorChanged() {
98 UpdateFocusRing(); 98 UpdateFocusRing();
99 } 99 }
100 100
101 void FocusRingController::OnAnimationStep(base::TimeTicks timestamp) {}
102
101 void FocusRingController::SetWidget(views::Widget* widget) { 103 void FocusRingController::SetWidget(views::Widget* widget) {
102 if (widget_) { 104 if (widget_) {
103 widget_->RemoveObserver(this); 105 widget_->RemoveObserver(this);
104 if (widget_->GetFocusManager()) 106 if (widget_->GetFocusManager())
105 widget_->GetFocusManager()->RemoveFocusChangeListener(this); 107 widget_->GetFocusManager()->RemoveFocusChangeListener(this);
106 } 108 }
107 109
108 widget_ = widget; 110 widget_ = widget;
109 111
110 if (widget_) { 112 if (widget_) {
(...skipping 26 matching lines...) Expand all
137 views::View* focused_now) { 139 views::View* focused_now) {
138 } 140 }
139 141
140 void FocusRingController::OnDidChangeFocus(views::View* focused_before, 142 void FocusRingController::OnDidChangeFocus(views::View* focused_before,
141 views::View* focused_now) { 143 views::View* focused_now) {
142 DCHECK_EQ(focused_now, widget_->GetFocusManager()->GetFocusedView()); 144 DCHECK_EQ(focused_now, widget_->GetFocusManager()->GetFocusedView());
143 UpdateFocusRing(); 145 UpdateFocusRing();
144 } 146 }
145 147
146 } // namespace chromeos 148 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/ui/focus_ring_controller.h ('k') | chrome/browser/chromeos/ui/focus_ring_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698