Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: ash/shell.cc

Issue 11273098: Relanding the EventTarget fixes for Aura (Ash) as the previous attempt was reverted due to interact… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell.h ('k') | ash/wm/event_client_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/wm/event_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698