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

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

Issue 2868723006: Changing focus ring color by node. Focus ring can now change color without changing bounds (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/switch_access/automation_manager.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_layer.h" 5 #include "chrome/browser/chromeos/ui/focus_ring_layer.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/compositor/compositor_animation_observer.h" 8 #include "ui/compositor/compositor_animation_observer.h"
9 #include "ui/compositor/layer.h" 9 #include "ui/compositor/layer.h"
10 #include "ui/compositor/paint_recorder.h" 10 #include "ui/compositor/paint_recorder.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 layer_->set_delegate(this); 71 layer_->set_delegate(this);
72 layer_->SetFillsBoundsOpaquely(false); 72 layer_->SetFillsBoundsOpaquely(false);
73 root_layer->Add(layer_.get()); 73 root_layer->Add(layer_.get());
74 } 74 }
75 75
76 // Keep moving it to the top in case new layers have been added 76 // Keep moving it to the top in case new layers have been added
77 // since we created this layer. 77 // since we created this layer.
78 layer_->parent()->StackAtTop(layer_.get()); 78 layer_->parent()->StackAtTop(layer_.get());
79 79
80 layer_->SetBounds(bounds); 80 layer_->SetBounds(bounds);
81 gfx::Rect* layer_bounds =
dmazzoni 2017/05/09 17:05:09 If you create an object with "new" you also have t
elichtenberg 2017/05/09 17:26:55 Done.
82 new gfx::Rect(0, 0, bounds.width(), bounds.height());
83 layer_->SchedulePaint(*layer_bounds);
81 84
82 // Update the animation observer. 85 // Update the animation observer.
83 display::Display display = 86 display::Display display =
84 display::Screen::GetScreen()->GetDisplayMatching(bounds); 87 display::Screen::GetScreen()->GetDisplayMatching(bounds);
85 ui::Compositor* compositor = root_window->layer()->GetCompositor(); 88 ui::Compositor* compositor = root_window->layer()->GetCompositor();
86 if (compositor != compositor_) { 89 if (compositor != compositor_) {
87 if (compositor_ && compositor_->HasAnimationObserver(this)) 90 if (compositor_ && compositor_->HasAnimationObserver(this))
88 compositor_->RemoveAnimationObserver(this); 91 compositor_->RemoveAnimationObserver(this);
89 compositor_ = compositor; 92 compositor_ = compositor;
90 if (compositor_ && !compositor_->HasAnimationObserver(this)) 93 if (compositor_ && !compositor_->HasAnimationObserver(this))
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 132 }
130 133
131 void FocusRingLayer::OnCompositingShuttingDown(ui::Compositor* compositor) { 134 void FocusRingLayer::OnCompositingShuttingDown(ui::Compositor* compositor) {
132 if (compositor == compositor_) { 135 if (compositor == compositor_) {
133 compositor->RemoveAnimationObserver(this); 136 compositor->RemoveAnimationObserver(this);
134 compositor_ = nullptr; 137 compositor_ = nullptr;
135 } 138 }
136 } 139 }
137 140
138 } // namespace chromeos 141 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/switch_access/automation_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698