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

Side by Side Diff: ash/autoclick/common/autoclick_ring_handler.cc

Issue 2901503003: Rename GetPreferredSize to CalculatePreferredSize in ash/ (Closed)
Patch Set: improvements 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/autoclick/common/autoclick_ring_handler.h" 5 #include "ash/autoclick/common/autoclick_ring_handler.h"
6 6
7 #include "third_party/skia/include/core/SkColor.h" 7 #include "third_party/skia/include/core/SkColor.h"
8 #include "third_party/skia/include/core/SkPath.h" 8 #include "third_party/skia/include/core/SkPath.h"
9 #include "third_party/skia/include/core/SkRect.h" 9 #include "third_party/skia/include/core/SkRect.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 current_scale_ = animation->CurrentValueBetween( 122 current_scale_ = animation->CurrentValueBetween(
123 kAutoclickRingScaleEndValue, kAutoclickRingShrinkScaleEndValue); 123 kAutoclickRingScaleEndValue, kAutoclickRingShrinkScaleEndValue);
124 widget_->GetNativeView()->layer()->SetOpacity( 124 widget_->GetNativeView()->layer()->SetOpacity(
125 animation->CurrentValueBetween(kAutoclickRingOpacityStartValue, 125 animation->CurrentValueBetween(kAutoclickRingOpacityStartValue,
126 kAutoclickRingOpacityEndValue)); 126 kAutoclickRingOpacityEndValue));
127 SchedulePaint(); 127 SchedulePaint();
128 } 128 }
129 129
130 private: 130 private:
131 // Overridden from views::View. 131 // Overridden from views::View.
132 gfx::Size GetPreferredSize() const override { 132 gfx::Size CalculatePreferredSize() const override {
133 return gfx::Size(2 * (kAutoclickRingOuterRadius + kAutoclickRingGlowWidth), 133 return gfx::Size(2 * (kAutoclickRingOuterRadius + kAutoclickRingGlowWidth),
134 2 * (kAutoclickRingOuterRadius + kAutoclickRingGlowWidth)); 134 2 * (kAutoclickRingOuterRadius + kAutoclickRingGlowWidth));
135 } 135 }
136 136
137 void OnPaint(gfx::Canvas* canvas) override { 137 void OnPaint(gfx::Canvas* canvas) override {
138 gfx::Point center(GetPreferredSize().width() / 2, 138 gfx::Point center(GetPreferredSize().width() / 2,
139 GetPreferredSize().height() / 2); 139 GetPreferredSize().height() / 2);
140 canvas->Save(); 140 canvas->Save();
141 141
142 gfx::Transform scale; 142 gfx::Transform scale;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 current_animation_type_ = AnimationType::NONE; 256 current_animation_type_ = AnimationType::NONE;
257 break; 257 break;
258 case AnimationType::NONE: 258 case AnimationType::NONE:
259 // fall through to reset the view. 259 // fall through to reset the view.
260 view_.reset(); 260 view_.reset();
261 break; 261 break;
262 } 262 }
263 } 263 }
264 264
265 } // namespace ash 265 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/exit_warning_handler.cc ('k') | ash/frame/caption_buttons/frame_caption_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698