OLD | NEW |
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/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 return; | 348 return; |
349 | 349 |
350 Window* old_active = active_window_; | 350 Window* old_active = active_window_; |
351 active_window_ = window; | 351 active_window_ = window; |
352 // Invoke OnLostActive after we've changed the active window. That way if the | 352 // Invoke OnLostActive after we've changed the active window. That way if the |
353 // delegate queries for active state it doesn't think the window is still | 353 // delegate queries for active state it doesn't think the window is still |
354 // active. | 354 // active. |
355 if (old_active && old_active->delegate()) | 355 if (old_active && old_active->delegate()) |
356 old_active->delegate()->OnLostActive(); | 356 old_active->delegate()->OnLostActive(); |
357 if (active_window_) { | 357 if (active_window_) { |
358 active_window_->parent()->MoveChildToFront(active_window_); | 358 active_window_->parent()->StackChildAtTop(active_window_); |
359 if (active_window_->delegate()) | 359 if (active_window_->delegate()) |
360 active_window_->delegate()->OnActivated(); | 360 active_window_->delegate()->OnActivated(); |
361 active_window_->GetFocusManager()->SetFocusedWindow( | 361 active_window_->GetFocusManager()->SetFocusedWindow( |
362 to_focus ? to_focus : active_window_); | 362 to_focus ? to_focus : active_window_); |
363 } | 363 } |
364 FOR_EACH_OBSERVER(DesktopObserver, observers_, | 364 FOR_EACH_OBSERVER(DesktopObserver, observers_, |
365 OnActiveWindowChanged(active_window_)); | 365 OnActiveWindowChanged(active_window_)); |
366 } | 366 } |
367 | 367 |
368 void Desktop::ActivateTopmostWindow() { | 368 void Desktop::ActivateTopmostWindow() { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 629 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
630 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 630 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
631 } else if (use_fullscreen_host_window_) { | 631 } else if (use_fullscreen_host_window_) { |
632 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); | 632 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); |
633 } | 633 } |
634 | 634 |
635 return bounds; | 635 return bounds; |
636 } | 636 } |
637 | 637 |
638 } // namespace aura | 638 } // namespace aura |
OLD | NEW |