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/root_window.h" | 5 #include "ui/aura/root_window.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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 470 } |
471 | 471 |
472 void RootWindow::SetFocusedWindow(Window* focused_window) { | 472 void RootWindow::SetFocusedWindow(Window* focused_window) { |
473 if (focused_window == focused_window_) | 473 if (focused_window == focused_window_) |
474 return; | 474 return; |
475 if (focused_window && !focused_window->CanFocus()) | 475 if (focused_window && !focused_window->CanFocus()) |
476 return; | 476 return; |
477 // The NULL-check of |focused)window| is essential here before asking the | 477 // The NULL-check of |focused)window| is essential here before asking the |
478 // activation client, since it is valid to clear the focus by calling | 478 // activation client, since it is valid to clear the focus by calling |
479 // SetFocusedWindow() to NULL. | 479 // SetFocusedWindow() to NULL. |
480 if (focused_window && ActivationClient::GetActivationClient() && | 480 if (focused_window && client::GetActivationClient() && |
481 !ActivationClient::GetActivationClient()->CanFocusWindow( | 481 !client::GetActivationClient()->CanFocusWindow(focused_window)) { |
482 focused_window)) { | |
483 return; | 482 return; |
484 } | 483 } |
485 | 484 |
486 if (focused_window_ && focused_window_->delegate()) | 485 if (focused_window_ && focused_window_->delegate()) |
487 focused_window_->delegate()->OnBlur(); | 486 focused_window_->delegate()->OnBlur(); |
488 focused_window_ = focused_window; | 487 focused_window_ = focused_window; |
489 if (focused_window_ && focused_window_->delegate()) | 488 if (focused_window_ && focused_window_->delegate()) |
490 focused_window_->delegate()->OnFocus(); | 489 focused_window_->delegate()->OnFocus(); |
491 if (focused_window_) { | 490 if (focused_window_) { |
492 FOR_EACH_OBSERVER(RootWindowObserver, observers_, | 491 FOR_EACH_OBSERVER(RootWindowObserver, observers_, |
(...skipping 30 matching lines...) Expand all Loading... |
523 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 522 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
524 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 523 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
525 } else if (use_fullscreen_host_window_) { | 524 } else if (use_fullscreen_host_window_) { |
526 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); | 525 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); |
527 } | 526 } |
528 | 527 |
529 return bounds; | 528 return bounds; |
530 } | 529 } |
531 | 530 |
532 } // namespace aura | 531 } // namespace aura |
OLD | NEW |