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

Side by Side Diff: ui/aura_shell/shadow.cc

Issue 9026017: Move some more files into ash... this time seed the window manager dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | « ui/aura_shell/shadow.h ('k') | ui/aura_shell/shadow_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/aura_shell/shadow.h"
6
7 #include "grit/ui_resources.h"
8 #include "ui/aura_shell/image_grid.h"
9 #include "ui/base/resource/resource_bundle.h"
10
11 namespace aura_shell {
12 namespace internal {
13
14 Shadow::Shadow() {
15 }
16
17 Shadow::~Shadow() {
18 }
19
20 ui::Layer* Shadow::layer() const { return image_grid_->layer(); }
21
22 void Shadow::Init() {
23 image_grid_.reset(new ImageGrid);
24
25 ResourceBundle& res = ResourceBundle::GetSharedInstance();
26 image_grid_->Init(&res.GetImageNamed(IDR_AURA_SHADOW_RECT_TOP_LEFT),
27 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_TOP),
28 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_TOP_RIGHT),
29 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_LEFT),
30 NULL,
31 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_RIGHT),
32 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_BOTTOM_LEFT),
33 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_BOTTOM),
34 &res.GetImageNamed(IDR_AURA_SHADOW_RECT_BOTTOM_RIGHT));
35 }
36
37 void Shadow::SetContentBounds(const gfx::Rect& content_bounds) {
38 content_bounds_ = content_bounds;
39 image_grid_->SetSize(
40 gfx::Size(content_bounds.width() +
41 image_grid_->left_image_width() +
42 image_grid_->right_image_width(),
43 content_bounds.height() +
44 image_grid_->top_image_height() +
45 image_grid_->bottom_image_height()));
46 image_grid_->layer()->SetBounds(
47 gfx::Rect(content_bounds.x() - image_grid_->left_image_width(),
48 content_bounds.y() - image_grid_->top_image_height(),
49 image_grid_->layer()->bounds().width(),
50 image_grid_->layer()->bounds().height()));
51 }
52
53 } // namespace internal
54 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/shadow.h ('k') | ui/aura_shell/shadow_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698