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

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

Issue 10442017: Rename GetRootWindow() -> GetPrimaryRootWindow() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git-try -b linux_chromeos,win_aura Created 8 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/wm/screen_dimmer_unittest.cc ('k') | ash/wm/shelf_layout_manager.cc » ('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/shadow_controller.h" 5 #include "ash/wm/shadow_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/shadow.h" 10 #include "ash/wm/shadow.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 return Shadow::STYLE_INACTIVE; 66 return Shadow::STYLE_INACTIVE;
67 } 67 }
68 68
69 } // namespace 69 } // namespace
70 70
71 ShadowController::ShadowController() 71 ShadowController::ShadowController()
72 : ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)) { 72 : ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)) {
73 aura::Env::GetInstance()->AddObserver(this); 73 aura::Env::GetInstance()->AddObserver(this);
74 // Watch for window activation changes. 74 // Watch for window activation changes.
75 Shell::GetRootWindow()->AddObserver(this); 75 Shell::GetPrimaryRootWindow()->AddObserver(this);
76 } 76 }
77 77
78 ShadowController::~ShadowController() { 78 ShadowController::~ShadowController() {
79 Shell::GetRootWindow()->RemoveObserver(this); 79 Shell::GetPrimaryRootWindow()->RemoveObserver(this);
80 aura::Env::GetInstance()->RemoveObserver(this); 80 aura::Env::GetInstance()->RemoveObserver(this);
81 } 81 }
82 82
83 void ShadowController::OnWindowInitialized(aura::Window* window) { 83 void ShadowController::OnWindowInitialized(aura::Window* window) {
84 observer_manager_.Add(window); 84 observer_manager_.Add(window);
85 SetShadowType(window, GetShadowTypeFromWindow(window)); 85 SetShadowType(window, GetShadowTypeFromWindow(window));
86 HandlePossibleShadowVisibilityChange(window); 86 HandlePossibleShadowVisibilityChange(window);
87 } 87 }
88 88
89 void ShadowController::OnWindowPropertyChanged(aura::Window* window, 89 void ShadowController::OnWindowPropertyChanged(aura::Window* window,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 shadow->Init(ShouldUseSmallShadowForWindow(window) ? 166 shadow->Init(ShouldUseSmallShadowForWindow(window) ?
167 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); 167 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE);
168 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); 168 shadow->SetContentBounds(gfx::Rect(window->bounds().size()));
169 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); 169 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window));
170 window->layer()->Add(shadow->layer()); 170 window->layer()->Add(shadow->layer());
171 } 171 }
172 172
173 } // namespace internal 173 } // namespace internal
174 } // namespace ash 174 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/screen_dimmer_unittest.cc ('k') | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698