Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 root_window_->RemoveObserver(this); | 147 root_window_->RemoveObserver(this); |
| 148 root_window_ = NULL; | 148 root_window_ = NULL; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 | 151 |
| 152 ////////////////////////////////////////////////////////////////////////////// | 152 ////////////////////////////////////////////////////////////////////////////// |
| 153 // BaseLayoutManager, aura::client::ActivationChangeObserver implementation: | 153 // BaseLayoutManager, aura::client::ActivationChangeObserver implementation: |
| 154 | 154 |
| 155 void BaseLayoutManager::OnWindowActivated(aura::Window* gained_active, | 155 void BaseLayoutManager::OnWindowActivated(aura::Window* gained_active, |
| 156 aura::Window* lost_active) { | 156 aura::Window* lost_active) { |
| 157 if (gained_active && wm::IsWindowMinimized(gained_active)) { | |
|
Ben Goodger (Google)
2013/01/07 22:10:18
Can you try running ash_unittests with --use-focus
| |
| 158 gained_active->Show(); | |
| 159 DCHECK(!wm::IsWindowMinimized(gained_active)); | |
| 160 } | |
| 161 } | 157 } |
| 162 | 158 |
| 163 ////////////////////////////////////////////////////////////////////////////// | 159 ////////////////////////////////////////////////////////////////////////////// |
| 164 // BaseLayoutManager, private: | 160 // BaseLayoutManager, private: |
| 165 | 161 |
| 166 void BaseLayoutManager::ShowStateChanged(aura::Window* window, | 162 void BaseLayoutManager::ShowStateChanged(aura::Window* window, |
| 167 ui::WindowShowState last_show_state) { | 163 ui::WindowShowState last_show_state) { |
| 168 if (wm::IsWindowMinimized(window)) { | 164 if (wm::IsWindowMinimized(window)) { |
| 169 // Save the previous show state so that we can correctly restore it. | 165 // Save the previous show state so that we can correctly restore it. |
| 170 window->SetProperty(internal::kRestoreShowStateKey, last_show_state); | 166 window->SetProperty(internal::kRestoreShowStateKey, last_show_state); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 // Put as much of the window as possible within the display area. | 237 // Put as much of the window as possible within the display area. |
| 242 gfx::Rect bounds = window->bounds(); | 238 gfx::Rect bounds = window->bounds(); |
| 243 bounds.AdjustToFit(display_rect); | 239 bounds.AdjustToFit(display_rect); |
| 244 window->SetBounds(bounds); | 240 window->SetBounds(bounds); |
| 245 } | 241 } |
| 246 } | 242 } |
| 247 } | 243 } |
| 248 | 244 |
| 249 } // namespace internal | 245 } // namespace internal |
| 250 } // namespace ash | 246 } // namespace ash |
| OLD | NEW |