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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 // The layer, and all the observers should be notified of the | 316 // The layer, and all the observers should be notified of the |
317 // transformed size of the desktop. | 317 // transformed size of the desktop. |
318 gfx::Rect bounds(size); | 318 gfx::Rect bounds(size); |
319 layer()->transform().TransformRect(&bounds); | 319 layer()->transform().TransformRect(&bounds); |
320 SetBounds(gfx::Rect(bounds.size())); | 320 SetBounds(gfx::Rect(bounds.size())); |
321 FOR_EACH_OBSERVER(DesktopObserver, observers_, | 321 FOR_EACH_OBSERVER(DesktopObserver, observers_, |
322 OnDesktopResized(bounds.size())); | 322 OnDesktopResized(bounds.size())); |
323 } | 323 } |
324 | 324 |
325 void Desktop::SetActiveWindow(Window* window, Window* to_focus) { | 325 void Desktop::SetActiveWindow(Window* window, Window* to_focus) { |
326 if (!window) | |
sky
2011/11/14 21:12:21
Don't we use this to clear the active window? Say
| |
327 return; | |
326 // The stacking client may impose rules on what window configurations can be | 328 // The stacking client may impose rules on what window configurations can be |
327 // activated or deactivated. | 329 // activated or deactivated. |
328 if (window && !stacking_client_->CanActivateWindow(window)) | 330 if (!stacking_client_->CanActivateWindow(window)) |
329 return; | 331 return; |
330 // The window may not be activate-able. | 332 // The window may not be activate-able. |
331 if (window && !window->CanActivate()) | 333 if (!window->CanActivate()) |
332 return; | 334 return; |
333 // Nothing may actually have changed. | 335 // Nothing may actually have changed. |
334 if (active_window_ == window) | 336 if (active_window_ == window) |
335 return; | 337 return; |
336 | 338 |
337 Window* old_active = active_window_; | 339 Window* old_active = active_window_; |
338 active_window_ = window; | 340 active_window_ = window; |
339 // Invoke OnLostActive after we've changed the active window. That way if the | 341 // Invoke OnLostActive after we've changed the active window. That way if the |
340 // delegate queries for active state it doesn't think the window is still | 342 // delegate queries for active state it doesn't think the window is still |
341 // active. | 343 // active. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
604 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 606 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
605 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 607 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
606 } else if (use_fullscreen_host_window_) { | 608 } else if (use_fullscreen_host_window_) { |
607 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); | 609 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); |
608 } | 610 } |
609 | 611 |
610 return bounds; | 612 return bounds; |
611 } | 613 } |
612 | 614 |
613 } // namespace aura | 615 } // namespace aura |
OLD | NEW |