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

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

Issue 11633029: Remove ash::window::Show() from BaseLayoutManager::OnWindowActivated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | 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/base_layout_manager.h" 5 #include "ash/wm/base_layout_manager.h"
6 6
7 #include "ash/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/wm/shelf_layout_manager.h" 9 #include "ash/wm/shelf_layout_manager.h"
10 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
11 #include "ash/wm/window_properties.h" 11 #include "ash/wm/window_properties.h"
12 #include "ash/wm/window_util.h" 12 #include "ash/wm/window_util.h"
13 #include "ash/wm/workspace/workspace_window_resizer.h" 13 #include "ash/wm/workspace/workspace_window_resizer.h"
14 #include "ui/aura/client/activation_client.h" 14 #include "ui/aura/client/activation_client.h"
15 #include "ui/aura/client/aura_constants.h" 15 #include "ui/aura/client/aura_constants.h"
16 #include "ui/aura/root_window.h" 16 #include "ui/aura/root_window.h"
17 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
18 #include "ui/base/ui_base_types.h" 18 #include "ui/base/ui_base_types.h"
19 #include "ui/compositor/layer.h" 19 #include "ui/compositor/layer.h"
20 #include "ui/gfx/screen.h" 20 #include "ui/gfx/screen.h"
21 #include "ui/views/corewm/corewm_switches.h"
21 #include "ui/views/corewm/window_util.h" 22 #include "ui/views/corewm/window_util.h"
22 23
23 namespace ash { 24 namespace ash {
24 namespace internal { 25 namespace internal {
25 26
26 ///////////////////////////////////////////////////////////////////////////// 27 /////////////////////////////////////////////////////////////////////////////
27 // BaseLayoutManager, public: 28 // BaseLayoutManager, public:
28 29
29 BaseLayoutManager::BaseLayoutManager(aura::RootWindow* root_window) 30 BaseLayoutManager::BaseLayoutManager(aura::RootWindow* root_window)
30 : root_window_(root_window) { 31 : root_window_(root_window) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 root_window_->RemoveObserver(this); 148 root_window_->RemoveObserver(this);
148 root_window_ = NULL; 149 root_window_ = NULL;
149 } 150 }
150 } 151 }
151 152
152 ////////////////////////////////////////////////////////////////////////////// 153 //////////////////////////////////////////////////////////////////////////////
153 // BaseLayoutManager, aura::client::ActivationChangeObserver implementation: 154 // BaseLayoutManager, aura::client::ActivationChangeObserver implementation:
154 155
155 void BaseLayoutManager::OnWindowActivated(aura::Window* gained_active, 156 void BaseLayoutManager::OnWindowActivated(aura::Window* gained_active,
156 aura::Window* lost_active) { 157 aura::Window* lost_active) {
157 if (gained_active && wm::IsWindowMinimized(gained_active)) { 158 if (views::corewm::UseFocusController()) {
158 gained_active->Show(); 159 if (gained_active && wm::IsWindowMinimized(gained_active)) {
159 DCHECK(!wm::IsWindowMinimized(gained_active)); 160 gained_active->Show();
161 DCHECK(!wm::IsWindowMinimized(gained_active));
162 }
160 } 163 }
161 } 164 }
162 165
163 ////////////////////////////////////////////////////////////////////////////// 166 //////////////////////////////////////////////////////////////////////////////
164 // BaseLayoutManager, private: 167 // BaseLayoutManager, private:
165 168
166 void BaseLayoutManager::ShowStateChanged(aura::Window* window, 169 void BaseLayoutManager::ShowStateChanged(aura::Window* window,
167 ui::WindowShowState last_show_state) { 170 ui::WindowShowState last_show_state) {
168 if (wm::IsWindowMinimized(window)) { 171 if (wm::IsWindowMinimized(window)) {
169 // Save the previous show state so that we can correctly restore it. 172 // Save the previous show state so that we can correctly restore it.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // Put as much of the window as possible within the display area. 244 // Put as much of the window as possible within the display area.
242 gfx::Rect bounds = window->bounds(); 245 gfx::Rect bounds = window->bounds();
243 bounds.AdjustToFit(display_rect); 246 bounds.AdjustToFit(display_rect);
244 window->SetBounds(bounds); 247 window->SetBounds(bounds);
245 } 248 }
246 } 249 }
247 } 250 }
248 251
249 } // namespace internal 252 } // namespace internal
250 } // namespace ash 253 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698