Chromium Code Reviews| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 503 | 503 |
| 504 if (initially_hide_cursor_) | 504 if (initially_hide_cursor_) |
| 505 cursor_manager_.ShowCursor(false); | 505 cursor_manager_.ShowCursor(false); |
| 506 | 506 |
| 507 // Cursor might have been hidden by somethign other than chrome. | 507 // Cursor might have been hidden by somethign other than chrome. |
| 508 // Let the first mouse event show the cursor. | 508 // Let the first mouse event show the cursor. |
| 509 env_filter_->set_cursor_hidden_by_filter(true); | 509 env_filter_->set_cursor_hidden_by_filter(true); |
| 510 } | 510 } |
| 511 | 511 |
| 512 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { | 512 void Shell::AddEnvEventFilter(aura::EventFilter* filter) { |
| 513 aura::Env::GetInstance()->AddPreTargetHandler(filter); | 513 AddPreTargetHandler(filter); |
| 514 } | 514 } |
| 515 | 515 |
| 516 void Shell::RemoveEnvEventFilter(aura::EventFilter* filter) { | 516 void Shell::RemoveEnvEventFilter(aura::EventFilter* filter) { |
| 517 aura::Env::GetInstance()->RemovePreTargetHandler(filter); | 517 RemovePreTargetHandler(filter); |
| 518 } | 518 } |
| 519 | 519 |
| 520 void Shell::ShowContextMenu(const gfx::Point& location_in_screen) { | 520 void Shell::ShowContextMenu(const gfx::Point& location_in_screen) { |
| 521 // No context menus if user have not logged in. | 521 // No context menus if user have not logged in. |
| 522 if (!delegate_.get() || !delegate_->IsUserLoggedIn()) | 522 if (!delegate_.get() || !delegate_->IsUserLoggedIn()) |
| 523 return; | 523 return; |
| 524 // No context menus when screen is locked. | 524 // No context menus when screen is locked. |
| 525 if (IsScreenLocked()) | 525 if (IsScreenLocked()) |
| 526 return; | 526 return; |
| 527 | 527 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 controller->CreateContainers(); | 726 controller->CreateContainers(); |
| 727 InitRootWindowController(controller); | 727 InitRootWindowController(controller); |
| 728 if (IsLauncherPerDisplayEnabled()) | 728 if (IsLauncherPerDisplayEnabled()) |
| 729 controller->InitForPrimaryDisplay(); | 729 controller->InitForPrimaryDisplay(); |
| 730 controller->root_window_layout()->OnWindowResized(); | 730 controller->root_window_layout()->OnWindowResized(); |
| 731 desktop_background_controller_->OnRootWindowAdded(root); | 731 desktop_background_controller_->OnRootWindowAdded(root); |
| 732 high_contrast_controller_->OnRootWindowAdded(root); | 732 high_contrast_controller_->OnRootWindowAdded(root); |
| 733 root->ShowRootWindow(); | 733 root->ShowRootWindow(); |
| 734 // Activate new root for testing. | 734 // Activate new root for testing. |
| 735 active_root_window_ = root; | 735 active_root_window_ = root; |
| 736 aura::client::SetEventClient(root, event_client_.get()); | |
|
Ben Goodger (Google)
2012/10/30 02:10:25
this should probably be done in rootwindowcontroll
| |
| 736 } | 737 } |
| 737 | 738 |
| 738 void Shell::DoInitialWorkspaceAnimation() { | 739 void Shell::DoInitialWorkspaceAnimation() { |
| 739 return GetPrimaryRootWindowController()->workspace_controller()-> | 740 return GetPrimaryRootWindowController()->workspace_controller()-> |
| 740 DoInitialAnimation(); | 741 DoInitialAnimation(); |
| 741 } | 742 } |
| 742 | 743 |
| 743 void Shell::InitRootWindowController( | 744 void Shell::InitRootWindowController( |
| 744 internal::RootWindowController* controller) { | 745 internal::RootWindowController* controller) { |
| 745 aura::RootWindow* root_window = controller->root_window(); | 746 aura::RootWindow* root_window = controller->root_window(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 795 for (RootWindowControllerList::iterator iter = controllers.begin(); | 796 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 796 iter != controllers.end(); ++iter) { | 797 iter != controllers.end(); ++iter) { |
| 797 if ((*iter)->GetSystemModalLayoutManager(window)-> | 798 if ((*iter)->GetSystemModalLayoutManager(window)-> |
| 798 CanWindowReceiveEvents(window)) { | 799 CanWindowReceiveEvents(window)) { |
| 799 return true; | 800 return true; |
| 800 } | 801 } |
| 801 } | 802 } |
| 802 return false; | 803 return false; |
| 803 } | 804 } |
| 804 | 805 |
| 806 bool Shell::CanAcceptEvents() { | |
| 807 return true; | |
| 808 } | |
| 809 | |
| 810 ui::EventTarget* Shell::GetParentTarget() { | |
| 811 return NULL; | |
| 812 } | |
| 813 | |
| 805 } // namespace ash | 814 } // namespace ash |
| OLD | NEW |