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

Side by Side Diff: ash/wm/resize_shadow.cc

Issue 11275296: Move shadow code to views\corewm (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/resize_shadow.h ('k') | ash/wm/shadow.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/resize_shadow.h" 5 #include "ash/wm/resize_shadow.h"
6 6
7 #include "ash/wm/image_grid.h"
8 #include "base/time.h" 7 #include "base/time.h"
9 #include "grit/ash_resources.h" 8 #include "grit/ash_resources.h"
10 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
11 #include "ui/base/hit_test.h" 10 #include "ui/base/hit_test.h"
12 #include "ui/base/resource/resource_bundle.h" 11 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/compositor/layer.h" 12 #include "ui/compositor/layer.h"
14 #include "ui/compositor/scoped_layer_animation_settings.h" 13 #include "ui/compositor/scoped_layer_animation_settings.h"
14 #include "ui/views/corewm/image_grid.h"
15 15
16 namespace { 16 namespace {
17 17
18 // Final opacity for resize effect. 18 // Final opacity for resize effect.
19 const float kShadowTargetOpacity = 0.25f; 19 const float kShadowTargetOpacity = 0.25f;
20 // Animation time for resize effect in milliseconds. 20 // Animation time for resize effect in milliseconds.
21 const int kShadowAnimationDurationMs = 100; 21 const int kShadowAnimationDurationMs = 100;
22 22
23 // Sets up a layer as invisible and fully transparent, without animating. 23 // Sets up a layer as invisible and fully transparent, without animating.
24 void InitLayer(ui::Layer* layer) { 24 void InitLayer(ui::Layer* layer) {
(...skipping 17 matching lines...) Expand all
42 namespace ash { 42 namespace ash {
43 namespace internal { 43 namespace internal {
44 44
45 ResizeShadow::ResizeShadow() : last_hit_test_(HTNOWHERE) {} 45 ResizeShadow::ResizeShadow() : last_hit_test_(HTNOWHERE) {}
46 46
47 ResizeShadow::~ResizeShadow() {} 47 ResizeShadow::~ResizeShadow() {}
48 48
49 void ResizeShadow::Init(aura::Window* window) { 49 void ResizeShadow::Init(aura::Window* window) {
50 // Set up our image grid and images. 50 // Set up our image grid and images.
51 ResourceBundle& res = ResourceBundle::GetSharedInstance(); 51 ResourceBundle& res = ResourceBundle::GetSharedInstance();
52 image_grid_.reset(new ImageGrid); 52 image_grid_.reset(new views::corewm::ImageGrid);
53 image_grid_->SetImages( 53 image_grid_->SetImages(
54 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP_LEFT), 54 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP_LEFT),
55 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP), 55 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP),
56 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP_RIGHT), 56 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_TOP_RIGHT),
57 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_LEFT), 57 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_LEFT),
58 NULL, 58 NULL,
59 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_RIGHT), 59 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_RIGHT),
60 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_BOTTOM_LEFT), 60 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_BOTTOM_LEFT),
61 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_BOTTOM), 61 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_BOTTOM),
62 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_BOTTOM_RIGHT)); 62 &res.GetImageNamed(IDR_AURA_RESIZE_SHADOW_BOTTOM_RIGHT));
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 ShowForHitTest(HTNOWHERE); 101 ShowForHitTest(HTNOWHERE);
102 } 102 }
103 103
104 void ResizeShadow::Layout(const gfx::Rect& content_bounds) { 104 void ResizeShadow::Layout(const gfx::Rect& content_bounds) {
105 gfx::Rect local_bounds(content_bounds.size()); 105 gfx::Rect local_bounds(content_bounds.size());
106 image_grid_->SetContentBounds(local_bounds); 106 image_grid_->SetContentBounds(local_bounds);
107 } 107 }
108 108
109 } // namespace internal 109 } // namespace internal
110 } // namespace ash 110 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/resize_shadow.h ('k') | ash/wm/shadow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698