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

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

Issue 700723004: Do not use vector<scoped_ptr<>>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month 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 "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" 5 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/chromeos/ui/focus_ring_layer.h" 10 #include "chrome/browser/chromeos/ui/focus_ring_layer.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Update(); 55 Update();
56 } 56 }
57 57
58 void AccessibilityFocusRingController::Update() { 58 void AccessibilityFocusRingController::Update() {
59 previous_rings_.swap(rings_); 59 previous_rings_.swap(rings_);
60 rings_.clear(); 60 rings_.clear();
61 RectsToRings(rects_, &rings_); 61 RectsToRings(rects_, &rings_);
62 layers_.resize(rings_.size()); 62 layers_.resize(rings_.size());
63 for (size_t i = 0; i < rings_.size(); ++i) { 63 for (size_t i = 0; i < rings_.size(); ++i) {
64 if (!layers_[i]) 64 if (!layers_[i])
65 layers_[i].reset(new AccessibilityFocusRingLayer(this)); 65 layers_[i] = new AccessibilityFocusRingLayer(this);
66 66
67 if (i > 0) { 67 if (i > 0) {
68 // Focus rings other than the first one don't animate. 68 // Focus rings other than the first one don't animate.
69 layers_[i]->Set(rings_[i]); 69 layers_[i]->Set(rings_[i]);
70 continue; 70 continue;
71 } 71 }
72 72
73 gfx::Rect bounds = rings_[0].GetBounds(); 73 gfx::Rect bounds = rings_[0].GetBounds();
74 gfx::Display display = 74 gfx::Display display =
75 gfx::Screen::GetNativeScreen()->GetDisplayMatching(bounds); 75 gfx::Screen::GetNativeScreen()->GetDisplayMatching(bounds);
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 double fraction = delta.InSecondsF() / transition_time.InSecondsF(); 316 double fraction = delta.InSecondsF() / transition_time.InSecondsF();
317 317
318 // Ease-in effect. 318 // Ease-in effect.
319 fraction = pow(fraction, 0.3); 319 fraction = pow(fraction, 0.3);
320 320
321 layers_[0]->Set(AccessibilityFocusRing::Interpolate( 321 layers_[0]->Set(AccessibilityFocusRing::Interpolate(
322 previous_rings_[0], rings_[0], fraction)); 322 previous_rings_[0], rings_[0], fraction));
323 } 323 }
324 324
325 } // namespace chromeos 325 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h ('k') | media/midi/midi_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698