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

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

Issue 8968022: Shell related switches -> aura shell switches. (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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "ui/aura_shell/shadow_controller.h" 5 #include "ui/aura_shell/shadow_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "ui/aura/aura_switches.h"
12 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/root_window.h" 11 #include "ui/aura/root_window.h"
14 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/aura_shell/aura_shell_switches.h"
15 #include "ui/aura_shell/shadow.h" 14 #include "ui/aura_shell/shadow.h"
16 #include "ui/aura_shell/shadow_types.h" 15 #include "ui/aura_shell/shadow_types.h"
17 #include "ui/aura_shell/window_properties.h" 16 #include "ui/aura_shell/window_properties.h"
18 17
19 using std::make_pair; 18 using std::make_pair;
20 19
21 namespace aura_shell { 20 namespace aura_shell {
22 namespace internal { 21 namespace internal {
23 22
24 namespace { 23 namespace {
25 24
26 ShadowType GetShadowTypeFromWindowType(aura::Window* window) { 25 ShadowType GetShadowTypeFromWindowType(aura::Window* window) {
27 switch (window->type()) { 26 switch (window->type()) {
28 case aura::WINDOW_TYPE_NORMAL: 27 case aura::client::WINDOW_TYPE_NORMAL:
29 return CommandLine::ForCurrentProcess()->HasSwitch( 28 return CommandLine::ForCurrentProcess()->HasSwitch(
30 switches::kAuraTranslucentFrames) ? 29 switches::kAuraTranslucentFrames) ?
31 SHADOW_TYPE_NONE : SHADOW_TYPE_RECTANGULAR; 30 SHADOW_TYPE_NONE : SHADOW_TYPE_RECTANGULAR;
32 case aura::WINDOW_TYPE_MENU: 31 case aura::client::WINDOW_TYPE_MENU:
33 case aura::WINDOW_TYPE_TOOLTIP: 32 case aura::client::WINDOW_TYPE_TOOLTIP:
34 return SHADOW_TYPE_RECTANGULAR; 33 return SHADOW_TYPE_RECTANGULAR;
35 default: 34 default:
36 break; 35 break;
37 } 36 }
38 return SHADOW_TYPE_NONE; 37 return SHADOW_TYPE_NONE;
39 } 38 }
40 39
41 } // namespace 40 } // namespace
42 41
43 ShadowController::ShadowController() { 42 ShadowController::ShadowController() {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 window_shadows_.insert(make_pair(window, shadow)); 108 window_shadows_.insert(make_pair(window, shadow));
110 109
111 shadow->Init(); 110 shadow->Init();
112 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); 111 shadow->SetContentBounds(gfx::Rect(window->bounds().size()));
113 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); 112 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window));
114 window->layer()->Add(shadow->layer()); 113 window->layer()->Add(shadow->layer());
115 } 114 }
116 115
117 } // namespace internal 116 } // namespace internal
118 } // namespace aura_shell 117 } // namespace aura_shell
OLDNEW
« no previous file with comments | « ui/aura_shell/root_window_event_filter_unittest.cc ('k') | ui/aura_shell/shadow_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698