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

Side by Side Diff: ash/wm/gestures/long_press_affordance_handler.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | ash/wm/panels/panel_frame_view.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wm/gestures/long_press_affordance_handler.h" 5 #include "ash/wm/gestures/long_press_affordance_handler.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 current_scale_ = animation->CurrentValueBetween(kAffordanceScaleEndValue, 180 current_scale_ = animation->CurrentValueBetween(kAffordanceScaleEndValue,
181 kAffordanceShrinkScaleEndValue); 181 kAffordanceShrinkScaleEndValue);
182 widget_->GetNativeView()->layer()->SetOpacity( 182 widget_->GetNativeView()->layer()->SetOpacity(
183 animation->CurrentValueBetween(kAffordanceOpacityEndValue, 183 animation->CurrentValueBetween(kAffordanceOpacityEndValue,
184 kAffordanceOpacityStartValue)); 184 kAffordanceOpacityStartValue));
185 SchedulePaint(); 185 SchedulePaint();
186 } 186 }
187 187
188 private: 188 private:
189 // Overridden from views::View. 189 // Overridden from views::View.
190 virtual gfx::Size GetPreferredSize() OVERRIDE { 190 virtual gfx::Size GetPreferredSize() const OVERRIDE {
191 return gfx::Size(2 * (kAffordanceOuterRadius + kAffordanceGlowWidth), 191 return gfx::Size(2 * (kAffordanceOuterRadius + kAffordanceGlowWidth),
192 2 * (kAffordanceOuterRadius + kAffordanceGlowWidth)); 192 2 * (kAffordanceOuterRadius + kAffordanceGlowWidth));
193 } 193 }
194 194
195 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 195 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
196 gfx::Point center(GetPreferredSize().width() / 2, 196 gfx::Point center(GetPreferredSize().width() / 2,
197 GetPreferredSize().height() / 2); 197 GetPreferredSize().height() / 2);
198 canvas->Save(); 198 canvas->Save();
199 199
200 gfx::Transform scale; 200 gfx::Transform scale;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 break; 358 break;
359 } 359 }
360 } 360 }
361 361
362 void LongPressAffordanceHandler::OnWindowDestroying(aura::Window* window) { 362 void LongPressAffordanceHandler::OnWindowDestroying(aura::Window* window) {
363 DCHECK_EQ(tap_down_target_, window); 363 DCHECK_EQ(tap_down_target_, window);
364 StopAffordance(); 364 StopAffordance();
365 } 365 }
366 366
367 } // namespace ash 367 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | ash/wm/panels/panel_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698