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

Side by Side Diff: ui/views/corewm/shadow_controller.cc

Issue 11421194: Hook up the FocusController behind a flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/views/corewm/shadow_controller.h ('k') | ui/views/views.gyp » ('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 "ui/views/corewm/shadow_controller.h" 5 #include "ui/views/corewm/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"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 gaining_active); 60 gaining_active);
61 if (it != losing_active->transient_children().end()) 61 if (it != losing_active->transient_children().end())
62 return Shadow::STYLE_ACTIVE; 62 return Shadow::STYLE_ACTIVE;
63 } 63 }
64 return Shadow::STYLE_INACTIVE; 64 return Shadow::STYLE_INACTIVE;
65 } 65 }
66 66
67 } // namespace 67 } // namespace
68 68
69 ShadowController::ShadowController(aura::RootWindow* root_window) 69 ShadowController::ShadowController(aura::RootWindow* root_window)
70 : ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)), 70 : ActivationChangeShim(root_window),
71 ALLOW_THIS_IN_INITIALIZER_LIST(observer_manager_(this)),
71 root_window_(root_window) { 72 root_window_(root_window) {
72 aura::Env::GetInstance()->AddObserver(this); 73 aura::Env::GetInstance()->AddObserver(this);
73 // Watch for window activation changes. 74 // Watch for window activation changes.
74 aura::client::GetActivationClient(root_window_)->AddObserver(this); 75 aura::client::GetActivationClient(root_window_)->AddObserver(this);
75 } 76 }
76 77
77 ShadowController::~ShadowController() { 78 ShadowController::~ShadowController() {
78 aura::client::GetActivationClient(root_window_)->RemoveObserver(this); 79 aura::client::GetActivationClient(root_window_)->RemoveObserver(this);
79 aura::Env::GetInstance()->RemoveObserver(this); 80 aura::Env::GetInstance()->RemoveObserver(this);
80 } 81 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 158
158 shadow->Init(ShouldUseSmallShadowForWindow(window) ? 159 shadow->Init(ShouldUseSmallShadowForWindow(window) ?
159 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE); 160 Shadow::STYLE_SMALL : Shadow::STYLE_ACTIVE);
160 shadow->SetContentBounds(gfx::Rect(window->bounds().size())); 161 shadow->SetContentBounds(gfx::Rect(window->bounds().size()));
161 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window)); 162 shadow->layer()->SetVisible(ShouldShowShadowForWindow(window));
162 window->layer()->Add(shadow->layer()); 163 window->layer()->Add(shadow->layer());
163 } 164 }
164 165
165 } // namespace corewm 166 } // namespace corewm
166 } // namespace views 167 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/shadow_controller.h ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698