| 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ash/accelerators/focus_manager_factory.h" | 10 #include "ash/accelerators/focus_manager_factory.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 609 |
| 610 if (!cursor_manager_.IsCursorVisible()) { | 610 if (!cursor_manager_.IsCursorVisible()) { |
| 611 // Cursor might have been hidden by something other than chrome. | 611 // Cursor might have been hidden by something other than chrome. |
| 612 // Let the first mouse event show the cursor. | 612 // Let the first mouse event show the cursor. |
| 613 env_filter_->set_cursor_hidden_by_filter(true); | 613 env_filter_->set_cursor_hidden_by_filter(true); |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 void Shell::ShowContextMenu(const gfx::Point& location_in_screen) { | 617 void Shell::ShowContextMenu(const gfx::Point& location_in_screen) { |
| 618 // No context menus if there is no session with an active user. | 618 // No context menus if there is no session with an active user. |
| 619 if (!session_state_delegate_->HasActiveUser()) | 619 if (!session_state_delegate_->NumberOfLoggedInUsers()) |
| 620 return; | 620 return; |
| 621 // No context menus when screen is locked. | 621 // No context menus when screen is locked. |
| 622 if (session_state_delegate_->IsScreenLocked()) | 622 if (session_state_delegate_->IsScreenLocked()) |
| 623 return; | 623 return; |
| 624 | 624 |
| 625 aura::RootWindow* root = | 625 aura::RootWindow* root = |
| 626 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size())); | 626 wm::GetRootWindowMatching(gfx::Rect(location_in_screen, gfx::Size())); |
| 627 // TODO(oshima): The root and root window controller shouldn't be | 627 // TODO(oshima): The root and root window controller shouldn't be |
| 628 // NULL even for the out-of-bounds |location_in_screen| (It should | 628 // NULL even for the out-of-bounds |location_in_screen| (It should |
| 629 // return the primary root). Investigate why/how this is | 629 // return the primary root). Investigate why/how this is |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 //////////////////////////////////////////////////////////////////////////////// | 947 //////////////////////////////////////////////////////////////////////////////// |
| 948 // Shell, aura::client::ActivationChangeObserver implementation: | 948 // Shell, aura::client::ActivationChangeObserver implementation: |
| 949 | 949 |
| 950 void Shell::OnWindowActivated(aura::Window* gained_active, | 950 void Shell::OnWindowActivated(aura::Window* gained_active, |
| 951 aura::Window* lost_active) { | 951 aura::Window* lost_active) { |
| 952 if (gained_active) | 952 if (gained_active) |
| 953 active_root_window_ = gained_active->GetRootWindow(); | 953 active_root_window_ = gained_active->GetRootWindow(); |
| 954 } | 954 } |
| 955 | 955 |
| 956 } // namespace ash | 956 } // namespace ash |
| OLD | NEW |