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/accelerator_controller.h" | 10 #include "ash/accelerators/accelerator_controller.h" |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 | 614 |
615 if (initially_hide_cursor_) | 615 if (initially_hide_cursor_) |
616 cursor_manager_.HideCursor(); | 616 cursor_manager_.HideCursor(); |
617 cursor_manager_.SetCursor(ui::kCursorPointer); | 617 cursor_manager_.SetCursor(ui::kCursorPointer); |
618 | 618 |
619 if (!cursor_manager_.IsCursorVisible()) { | 619 if (!cursor_manager_.IsCursorVisible()) { |
620 // Cursor might have been hidden by something other than chrome. | 620 // Cursor might have been hidden by something other than chrome. |
621 // Let the first mouse event show the cursor. | 621 // Let the first mouse event show the cursor. |
622 env_filter_->set_cursor_hidden_by_filter(true); | 622 env_filter_->set_cursor_hidden_by_filter(true); |
623 } | 623 } |
| 624 |
| 625 // The compositor thread and main message loop have to be running in |
| 626 // order to create mirror window. Run it after the main message loop |
| 627 // is started. |
| 628 base::MessageLoopForUI::current()->PostTask( |
| 629 FROM_HERE, |
| 630 base::Bind(&internal::DisplayManager::CreateMirrorWindowIfAny, |
| 631 base::Unretained(display_manager_.get()))); |
624 } | 632 } |
625 | 633 |
626 void Shell::ShowContextMenu(const gfx::Point& location_in_screen, | 634 void Shell::ShowContextMenu(const gfx::Point& location_in_screen, |
627 ui::MenuSourceType source_type) { | 635 ui::MenuSourceType source_type) { |
628 // No context menus if there is no session with an active user. | 636 // No context menus if there is no session with an active user. |
629 if (!session_state_delegate_->NumberOfLoggedInUsers()) | 637 if (!session_state_delegate_->NumberOfLoggedInUsers()) |
630 return; | 638 return; |
631 // No context menus when screen is locked. | 639 // No context menus when screen is locked. |
632 if (session_state_delegate_->IsScreenLocked()) | 640 if (session_state_delegate_->IsScreenLocked()) |
633 return; | 641 return; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 //////////////////////////////////////////////////////////////////////////////// | 965 //////////////////////////////////////////////////////////////////////////////// |
958 // Shell, aura::client::ActivationChangeObserver implementation: | 966 // Shell, aura::client::ActivationChangeObserver implementation: |
959 | 967 |
960 void Shell::OnWindowActivated(aura::Window* gained_active, | 968 void Shell::OnWindowActivated(aura::Window* gained_active, |
961 aura::Window* lost_active) { | 969 aura::Window* lost_active) { |
962 if (gained_active) | 970 if (gained_active) |
963 target_root_window_ = gained_active->GetRootWindow(); | 971 target_root_window_ = gained_active->GetRootWindow(); |
964 } | 972 } |
965 | 973 |
966 } // namespace ash | 974 } // namespace ash |
OLD | NEW |