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

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: Responded to comment 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(0, 0, bounds.width(), bounds.height());
82 layer_->SchedulePaint(layer_bounds);
81 83
82 // Update the animation observer. 84 // Update the animation observer.
83 display::Display display = 85 display::Display display =
84 display::Screen::GetScreen()->GetDisplayMatching(bounds); 86 display::Screen::GetScreen()->GetDisplayMatching(bounds);
85 ui::Compositor* compositor = root_window->layer()->GetCompositor(); 87 ui::Compositor* compositor = root_window->layer()->GetCompositor();
86 if (compositor != compositor_) { 88 if (compositor != compositor_) {
87 if (compositor_ && compositor_->HasAnimationObserver(this)) 89 if (compositor_ && compositor_->HasAnimationObserver(this))
88 compositor_->RemoveAnimationObserver(this); 90 compositor_->RemoveAnimationObserver(this);
89 compositor_ = compositor; 91 compositor_ = compositor;
90 if (compositor_ && !compositor_->HasAnimationObserver(this)) 92 if (compositor_ && !compositor_->HasAnimationObserver(this))
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 131 }
130 132
131 void FocusRingLayer::OnCompositingShuttingDown(ui::Compositor* compositor) { 133 void FocusRingLayer::OnCompositingShuttingDown(ui::Compositor* compositor) {
132 if (compositor == compositor_) { 134 if (compositor == compositor_) {
133 compositor->RemoveAnimationObserver(this); 135 compositor->RemoveAnimationObserver(this);
134 compositor_ = nullptr; 136 compositor_ = nullptr;
135 } 137 }
136 } 138 }
137 139
138 } // namespace chromeos 140 } // 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