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

Side by Side Diff: ash/shell.cc

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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
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/accelerator_controller.h" 10 #include "ash/accelerators/accelerator_controller.h"
(...skipping 11 matching lines...) Expand all
22 #include "ash/display/event_transformation_handler.h" 22 #include "ash/display/event_transformation_handler.h"
23 #include "ash/display/mouse_cursor_event_filter.h" 23 #include "ash/display/mouse_cursor_event_filter.h"
24 #include "ash/display/screen_position_controller.h" 24 #include "ash/display/screen_position_controller.h"
25 #include "ash/display/virtual_keyboard_window_controller.h" 25 #include "ash/display/virtual_keyboard_window_controller.h"
26 #include "ash/drag_drop/drag_drop_controller.h" 26 #include "ash/drag_drop/drag_drop_controller.h"
27 #include "ash/first_run/first_run_helper_impl.h" 27 #include "ash/first_run/first_run_helper_impl.h"
28 #include "ash/focus_cycler.h" 28 #include "ash/focus_cycler.h"
29 #include "ash/frame/custom_frame_view_ash.h" 29 #include "ash/frame/custom_frame_view_ash.h"
30 #include "ash/gpu_support.h" 30 #include "ash/gpu_support.h"
31 #include "ash/high_contrast/high_contrast_controller.h" 31 #include "ash/high_contrast/high_contrast_controller.h"
32 #include "ash/host/window_tree_host_factory.h"
33 #include "ash/keyboard_uma_event_filter.h" 32 #include "ash/keyboard_uma_event_filter.h"
34 #include "ash/magnifier/magnification_controller.h" 33 #include "ash/magnifier/magnification_controller.h"
35 #include "ash/magnifier/partial_magnification_controller.h" 34 #include "ash/magnifier/partial_magnification_controller.h"
36 #include "ash/media_delegate.h" 35 #include "ash/media_delegate.h"
37 #include "ash/new_window_delegate.h" 36 #include "ash/new_window_delegate.h"
38 #include "ash/root_window_controller.h" 37 #include "ash/root_window_controller.h"
39 #include "ash/session_state_delegate.h" 38 #include "ash/session_state_delegate.h"
40 #include "ash/shelf/app_list_shelf_item_delegate.h" 39 #include "ash/shelf/app_list_shelf_item_delegate.h"
41 #include "ash/shelf/shelf_delegate.h" 40 #include "ash/shelf/shelf_delegate.h"
42 #include "ash/shelf/shelf_item_delegate.h" 41 #include "ash/shelf/shelf_item_delegate.h"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 AddPreTargetHandler(env_filter_.get()); 835 AddPreTargetHandler(env_filter_.get());
837 836
838 ::wm::FocusController* focus_controller = 837 ::wm::FocusController* focus_controller =
839 new ::wm::FocusController(new wm::AshFocusRules); 838 new ::wm::FocusController(new wm::AshFocusRules);
840 focus_client_.reset(focus_controller); 839 focus_client_.reset(focus_controller);
841 activation_client_ = focus_controller; 840 activation_client_ = focus_controller;
842 activation_client_->AddObserver(this); 841 activation_client_->AddObserver(this);
843 focus_cycler_.reset(new internal::FocusCycler()); 842 focus_cycler_.reset(new internal::FocusCycler());
844 843
845 screen_position_controller_.reset(new internal::ScreenPositionController); 844 screen_position_controller_.reset(new internal::ScreenPositionController);
846 window_tree_host_factory_.reset(delegate_->CreateWindowTreeHostFactory());
847 845
848 display_controller_->Start(); 846 display_controller_->Start();
849 display_controller_->InitPrimaryDisplay(); 847 display_controller_->CreatePrimaryHost();
850 aura::Window* root_window = display_controller_->GetPrimaryRootWindow(); 848 aura::Window* root_window = display_controller_->GetPrimaryRootWindow();
851 target_root_window_ = root_window; 849 target_root_window_ = root_window;
852 850
853 #if defined(OS_CHROMEOS) 851 #if defined(OS_CHROMEOS)
854 resolution_notification_controller_.reset( 852 resolution_notification_controller_.reset(
855 new internal::ResolutionNotificationController); 853 new internal::ResolutionNotificationController);
856 #endif 854 #endif
857 855
858 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay()); 856 cursor_manager_.SetDisplay(GetScreen()->GetPrimaryDisplay());
859 857
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 system_tray_delegate_->Initialize(); 974 system_tray_delegate_->Initialize();
977 975
978 #if defined(OS_CHROMEOS) 976 #if defined(OS_CHROMEOS)
979 // Create the LogoutConfirmationController after the SystemTrayDelegate. 977 // Create the LogoutConfirmationController after the SystemTrayDelegate.
980 logout_confirmation_controller_.reset( 978 logout_confirmation_controller_.reset(
981 new internal::LogoutConfirmationController( 979 new internal::LogoutConfirmationController(
982 base::Bind(&SystemTrayDelegate::SignOut, 980 base::Bind(&SystemTrayDelegate::SignOut,
983 base::Unretained(system_tray_delegate_.get())))); 981 base::Unretained(system_tray_delegate_.get()))));
984 #endif 982 #endif
985 983
986 // TODO(oshima): Initialize all RootWindowControllers once, and 984 display_controller_->InitDisplays();
987 // initialize controller/delegates above when initializing the
988 // primary root window controller.
989 internal::RootWindowController::CreateForPrimaryDisplay(
990 root_window->GetHost());
991
992 display_controller_->InitSecondaryDisplays();
993 985
994 // It needs to be created after RootWindowController has been created 986 // It needs to be created after RootWindowController has been created
995 // (which calls OnWindowResized has been called, otherwise the 987 // (which calls OnWindowResized has been called, otherwise the
996 // widget will not paint when restoring after a browser crash. Also it needs 988 // widget will not paint when restoring after a browser crash. Also it needs
997 // to be created after InitSecondaryDisplays() to initialize the wallpapers in 989 // to be created after InitSecondaryDisplays() to initialize the wallpapers in
998 // the correct size. 990 // the correct size.
999 user_wallpaper_delegate_->InitializeWallpaper(); 991 user_wallpaper_delegate_->InitializeWallpaper();
1000 992
1001 if (initially_hide_cursor_) 993 if (initially_hide_cursor_)
1002 cursor_manager_.HideCursor(); 994 cursor_manager_.HideCursor();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 //////////////////////////////////////////////////////////////////////////////// 1107 ////////////////////////////////////////////////////////////////////////////////
1116 // Shell, aura::client::ActivationChangeObserver implementation: 1108 // Shell, aura::client::ActivationChangeObserver implementation:
1117 1109
1118 void Shell::OnWindowActivated(aura::Window* gained_active, 1110 void Shell::OnWindowActivated(aura::Window* gained_active,
1119 aura::Window* lost_active) { 1111 aura::Window* lost_active) {
1120 if (gained_active) 1112 if (gained_active)
1121 target_root_window_ = gained_active->GetRootWindow(); 1113 target_root_window_ = gained_active->GetRootWindow();
1122 } 1114 }
1123 1115
1124 } // namespace ash 1116 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698