diff options
Diffstat (limited to 'ash')
29 files changed, 121 insertions, 120 deletions
diff --git a/ash/cancel_mode.cc b/ash/cancel_mode.cc index 92f0543..df775d2 100644 --- a/ash/cancel_mode.cc +++ b/ash/cancel_mode.cc @@ -15,7 +15,7 @@ void DispatchCancelMode() { Shell::GetAllRootWindowControllers()); for (Shell::RootWindowControllerList::const_iterator i = controllers.begin(); i != controllers.end(); ++i) { - (*i)->root_window()->AsRootWindowHostDelegate()->OnHostCancelMode(); + (*i)->dispatcher()->AsRootWindowHostDelegate()->OnHostCancelMode(); } } diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc index 8673d0f..5557398 100644 --- a/ash/desktop_background/desktop_background_controller.cc +++ b/ash/desktop_background/desktop_background_controller.cc @@ -43,12 +43,6 @@ namespace { // changed? const int kWallpaperReloadDelayMs = 2000; -internal::RootWindowLayoutManager* GetRootWindowLayoutManager( - aura::RootWindow* root_window) { - return static_cast<internal::RootWindowLayoutManager*>( - root_window->layout_manager()); -} - } // namespace const int kSmallWallpaperMaxWidth = 1366; @@ -196,7 +190,7 @@ WallpaperLayout DesktopBackgroundController::GetWallpaperLayout() const { } void DesktopBackgroundController::OnRootWindowAdded( - aura::RootWindow* root_window) { + aura::Window* root_window) { // The background hasn't been set yet. if (desktop_background_mode_ == BACKGROUND_NONE) return; diff --git a/ash/desktop_background/desktop_background_controller.h b/ash/desktop_background/desktop_background_controller.h index 55a816a..4cfbc8e 100644 --- a/ash/desktop_background/desktop_background_controller.h +++ b/ash/desktop_background/desktop_background_controller.h @@ -14,7 +14,6 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/timer/timer.h" -#include "ui/aura/window.h" #include "ui/compositor/layer.h" #include "ui/gfx/image/image_skia.h" @@ -23,7 +22,7 @@ typedef unsigned int SkColor; class CommandLine; namespace aura { -class RootWindow; +class Window; } namespace ash { @@ -97,7 +96,7 @@ class ASH_EXPORT DesktopBackgroundController WallpaperLayout GetWallpaperLayout() const; // Initialize root window's background. - void OnRootWindowAdded(aura::RootWindow* root_window); + void OnRootWindowAdded(aura::Window* root_window); // Loads builtin wallpaper asynchronously and sets to current wallpaper // after loaded. Returns true if the controller started loading the diff --git a/ash/desktop_background/desktop_background_widget_controller.cc b/ash/desktop_background/desktop_background_widget_controller.cc index bd23b09..8d0aa67 100644 --- a/ash/desktop_background/desktop_background_widget_controller.cc +++ b/ash/desktop_background/desktop_background_widget_controller.cc @@ -92,7 +92,7 @@ void DesktopBackgroundWidgetController::SetBounds(gfx::Rect bounds) { widget_->SetBounds(bounds); } -bool DesktopBackgroundWidgetController::Reparent(aura::RootWindow* root_window, +bool DesktopBackgroundWidgetController::Reparent(aura::Window* root_window, int src_container, int dest_container) { if (widget_) { diff --git a/ash/desktop_background/desktop_background_widget_controller.h b/ash/desktop_background/desktop_background_widget_controller.h index c6fbbaa..5976f28 100644 --- a/ash/desktop_background/desktop_background_widget_controller.h +++ b/ash/desktop_background/desktop_background_widget_controller.h @@ -37,7 +37,7 @@ class ASH_EXPORT DesktopBackgroundWidgetController // Move component from |src_container| in |root_window| to |dest_container|. // It is required for lock screen, when we need to move background so that // it hides user's windows. Returns true if there was something to reparent. - bool Reparent(aura::RootWindow* root_window, + bool Reparent(aura::Window* root_window, int src_container, int dest_container); diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc index 2f78672..73c1aa0 100644 --- a/ash/display/display_controller.cc +++ b/ash/display/display_controller.cc @@ -123,7 +123,7 @@ void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root, 100 * display.device_scale_factor()); #endif scoped_ptr<aura::RootWindowTransformer> transformer( - internal::CreateRootWindowTransformerForDisplay(root, display)); + internal::CreateRootWindowTransformerForDisplay(root->window(), display)); root->SetRootWindowTransformer(transformer.Pass()); } @@ -264,7 +264,7 @@ void DisplayController::Shutdown() { Shell::GetScreen()->RemoveObserver(this); // Delete all root window controllers, which deletes root window // from the last so that the primary root window gets deleted last. - for (std::map<int64, aura::RootWindow*>::const_reverse_iterator it = + for (std::map<int64, aura::Window*>::const_reverse_iterator it = root_windows_.rbegin(); it != root_windows_.rend(); ++it) { internal::RootWindowController* controller = internal::GetRootWindowController(it->second); @@ -325,9 +325,9 @@ aura::Window* DisplayController::GetRootWindowForDisplayId(int64 id) { } void DisplayController::CloseChildWindows() { - for (std::map<int64, aura::RootWindow*>::const_iterator it = + for (std::map<int64, aura::Window*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { - aura::RootWindow* root_window = it->second; + aura::Window* root_window = it->second; internal::RootWindowController* controller = internal::GetRootWindowController(root_window); if (controller) { @@ -343,7 +343,7 @@ void DisplayController::CloseChildWindows() { aura::Window::Windows DisplayController::GetAllRootWindows() { aura::Window::Windows windows; - for (std::map<int64, aura::RootWindow*>::const_iterator it = + for (std::map<int64, aura::Window*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { DCHECK(it->second); if (internal::GetRootWindowController(it->second)) @@ -364,7 +364,7 @@ void DisplayController::SetOverscanInsets(int64 display_id, std::vector<internal::RootWindowController*> DisplayController::GetAllRootWindowControllers() { std::vector<internal::RootWindowController*> controllers; - for (std::map<int64, aura::RootWindow*>::const_iterator it = + for (std::map<int64, aura::Window*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { internal::RootWindowController* controller = internal::GetRootWindowController(it->second); @@ -447,7 +447,7 @@ void DisplayController::SetPrimaryDisplay( return; } - aura::RootWindow* non_primary_root = root_windows_[new_primary_display.id()]; + aura::Window* non_primary_root = root_windows_[new_primary_display.id()]; LOG_IF(ERROR, !non_primary_root) << "Unknown display is requested in SetPrimaryDisplay: id=" << new_primary_display.id(); @@ -457,7 +457,7 @@ void DisplayController::SetPrimaryDisplay( gfx::Display old_primary_display = GetPrimaryDisplay(); // Swap root windows between current and new primary display. - aura::RootWindow* primary_root = root_windows_[primary_display_id]; + aura::Window* primary_root = root_windows_[primary_display_id]; DCHECK(primary_root); DCHECK_NE(primary_root, non_primary_root); @@ -598,9 +598,10 @@ void DisplayController::OnDisplayBoundsChanged(const gfx::Display& display) { const internal::DisplayInfo& display_info = GetDisplayManager()->GetDisplayInfo(display.id()); DCHECK(!display_info.bounds_in_native().IsEmpty()); - aura::RootWindow* root = root_windows_[display.id()]; - root->SetHostBounds(display_info.bounds_in_native()); - SetDisplayPropertiesOnHostWindow(root, display); + aura::WindowEventDispatcher* dispatcher = + root_windows_[display.id()]->GetDispatcher(); + dispatcher->SetHostBounds(display_info.bounds_in_native()); + SetDisplayPropertiesOnHostWindow(dispatcher, display); } void DisplayController::OnDisplayAdded(const gfx::Display& display) { @@ -613,9 +614,10 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) { primary_root_window_for_replace_ = NULL; const internal::DisplayInfo& display_info = GetDisplayManager()->GetDisplayInfo(display.id()); - aura::RootWindow* root = root_windows_[display.id()]; - root->SetHostBounds(display_info.bounds_in_native()); - SetDisplayPropertiesOnHostWindow(root, display); + aura::WindowEventDispatcher* dispatcher = + root_windows_[display.id()]->GetDispatcher(); + dispatcher->SetHostBounds(display_info.bounds_in_native()); + SetDisplayPropertiesOnHostWindow(dispatcher, display); } else { if (primary_display_id == gfx::Display::kInvalidDisplayID) primary_display_id = display.id(); @@ -626,7 +628,7 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) { } void DisplayController::OnDisplayRemoved(const gfx::Display& display) { - aura::RootWindow* root_to_delete = root_windows_[display.id()]; + aura::Window* root_to_delete = root_windows_[display.id()]; DCHECK(root_to_delete) << display.ToString(); // Display for root window will be deleted when the Primary RootWindow @@ -645,7 +647,7 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) { } DCHECK_EQ(1U, root_windows_.size()); primary_display_id = ScreenAsh::GetSecondaryDisplay().id(); - aura::RootWindow* primary_root = root_to_delete; + aura::Window* primary_root = root_to_delete; // Delete the other root instead. root_to_delete = root_windows_[primary_display_id]; @@ -671,7 +673,7 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) { void DisplayController::OnRootWindowHostResized(const aura::RootWindow* root) { internal::DisplayManager* display_manager = GetDisplayManager(); - gfx::Display display = GetDisplayNearestWindow(root); + gfx::Display display = GetDisplayNearestWindow(root->window()); if (display_manager->UpdateDisplayBounds( display.id(), gfx::Rect(root->GetHostOrigin(), root->GetHostSize()))) { @@ -756,17 +758,18 @@ aura::RootWindow* DisplayController::AddRootWindowForDisplay( params.host = Shell::GetInstance()->root_window_host_factory()-> CreateRootWindowHost(bounds_in_native); aura::RootWindow* root_window = new aura::RootWindow(params); - root_window->SetName( + root_window->window()->SetName( base::StringPrintf("RootWindow-%d", root_window_count++)); root_window->compositor()->SetBackgroundColor(SK_ColorBLACK); // No need to remove RootWindowObserver because // the DisplayController object outlives RootWindow objects. root_window->AddRootWindowObserver(this); - internal::InitRootWindowSettings(root_window)->display_id = display.id(); + internal::InitRootWindowSettings(root_window->window())->display_id = + display.id(); root_window->Init(); root_windows_[display.id()] = root_window; - SetDisplayPropertiesOnHostWindow(root_window, display); + SetDisplayPropertiesOnHostWindow(root_window->GetDispatcher(), display); #if defined(OS_CHROMEOS) static bool force_constrain_pointer_to_root = diff --git a/ash/display/display_controller.h b/ash/display/display_controller.h index 07c4fa1..005eebd 100644 --- a/ash/display/display_controller.h +++ b/ash/display/display_controller.h @@ -201,13 +201,13 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver, scoped_ptr<DisplayChangeLimiter> limiter_; // The mapping from display ID to its root window. - std::map<int64, aura::RootWindow*> root_windows_; + std::map<int64, aura::Window*> root_windows_; ObserverList<Observer> observers_; // Store the primary root window temporarily while replacing // display. - aura::RootWindow* primary_root_window_for_replace_; + aura::Window* primary_root_window_for_replace_; scoped_ptr<internal::FocusActivationStore> focus_activation_store_; diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 92f5ca6..5f33d5a 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc @@ -980,7 +980,8 @@ TEST_F(DisplayManagerTest, SoftwareMirroring) { EXPECT_EQ("0,0 300x400", Shell::GetScreen()->GetPrimaryDisplay().bounds().ToString()); EXPECT_EQ("400x500", test_api.GetRootWindow()->GetHostSize().ToString()); - EXPECT_EQ("300x400", test_api.GetRootWindow()->bounds().size().ToString()); + EXPECT_EQ("300x400", + test_api.GetRootWindow()->window()->bounds().size().ToString()); EXPECT_TRUE(display_manager->IsMirrored()); display_manager->SetMirrorMode(false); @@ -996,24 +997,29 @@ TEST_F(DisplayManagerTest, SoftwareMirroring) { UpdateDisplay("300x400@0.5,400x500"); EXPECT_FALSE(display_observer.changed_and_reset()); - EXPECT_EQ("300x400", test_api.GetRootWindow()->bounds().size().ToString()); + EXPECT_EQ("300x400", + test_api.GetRootWindow()->window()->bounds().size().ToString()); UpdateDisplay("310x410*2,400x500"); EXPECT_FALSE(display_observer.changed_and_reset()); - EXPECT_EQ("310x410", test_api.GetRootWindow()->bounds().size().ToString()); + EXPECT_EQ("310x410", + test_api.GetRootWindow()->window()->bounds().size().ToString()); UpdateDisplay("320x420/r,400x500"); EXPECT_FALSE(display_observer.changed_and_reset()); - EXPECT_EQ("320x420", test_api.GetRootWindow()->bounds().size().ToString()); + EXPECT_EQ("320x420", + test_api.GetRootWindow()->window()->bounds().size().ToString()); UpdateDisplay("330x440/r,400x500"); EXPECT_FALSE(display_observer.changed_and_reset()); - EXPECT_EQ("330x440", test_api.GetRootWindow()->bounds().size().ToString()); + EXPECT_EQ("330x440", + test_api.GetRootWindow()->window()->bounds().size().ToString()); // Overscan insets are ignored. UpdateDisplay("400x600/o,600x800/o"); EXPECT_FALSE(display_observer.changed_and_reset()); - EXPECT_EQ("400x600", test_api.GetRootWindow()->bounds().size().ToString()); + EXPECT_EQ("400x600", + test_api.GetRootWindow()->window()->bounds().size().ToString()); Shell::GetScreen()->RemoveObserver(&display_observer); } diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc index 31cb7f4..a8e3ed9 100644 --- a/ash/display/mirror_window_controller.cc +++ b/ash/display/mirror_window_controller.cc @@ -163,7 +163,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { params.host = Shell::GetInstance()->root_window_host_factory()-> CreateRootWindowHost(bounds_in_native); root_window_.reset(new aura::RootWindow(params)); - root_window_->SetName( + root_window_->window()->SetName( base::StringPrintf("MirrorRootWindow-%d", mirror_root_window_count++)); root_window_->compositor()->SetBackgroundColor(SK_ColorBLACK); // No need to remove RootWindowObserver because @@ -172,20 +172,22 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { Shell::GetInstance()->display_controller()); root_window_->AddRootWindowObserver(this); // TODO(oshima): TouchHUD is using idkey. - InitRootWindowSettings(root_window_.get())->display_id = display_info.id(); + InitRootWindowSettings(root_window_->window())->display_id = + display_info.id(); root_window_->Init(); #if defined(USE_X11) DisableInput(root_window_->GetAcceleratedWidget()); #endif - aura::client::SetCaptureClient(root_window_.get(), new NoneCaptureClient()); + aura::client::SetCaptureClient(root_window_->window(), + new NoneCaptureClient()); root_window_->ShowRootWindow(); // TODO(oshima): Start mirroring. aura::Window* mirror_window = new aura::Window(NULL); mirror_window->Init(ui::LAYER_TEXTURED); - root_window_->AddChild(mirror_window); - mirror_window->SetBounds(root_window_->bounds()); + root_window_->window()->AddChild(mirror_window); + mirror_window->SetBounds(root_window_->window()->bounds()); mirror_window->Show(); reflector_ = ui::ContextFactory::GetInstance()->CreateReflector( Shell::GetPrimaryRootWindow()->GetDispatcher()->compositor(), @@ -194,10 +196,11 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { cursor_window_ = new aura::Window(cursor_window_delegate_.get()); cursor_window_->SetTransparent(true); cursor_window_->Init(ui::LAYER_TEXTURED); - root_window_->AddChild(cursor_window_); + root_window_->window()->AddChild(cursor_window_); cursor_window_->Show(); } else { - GetRootWindowSettings(root_window_.get())->display_id = display_info.id(); + GetRootWindowSettings(root_window_->window())->display_id = + display_info.id(); root_window_->SetHostBounds(display_info.bounds_in_native()); } @@ -228,8 +231,8 @@ void MirrorWindowController::Close() { ui::ContextFactory::GetInstance()->RemoveReflector(reflector_); reflector_ = NULL; NoneCaptureClient* capture_client = static_cast<NoneCaptureClient*>( - aura::client::GetCaptureClient(root_window_.get())); - aura::client::SetCaptureClient(root_window_.get(), NULL); + aura::client::GetCaptureClient(root_window_->window())); + aura::client::SetCaptureClient(root_window_->window(), NULL); delete capture_client; root_window_->RemoveRootWindowObserver( diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc index 32b2a90..9244894 100644 --- a/ash/display/screen_position_controller.cc +++ b/ash/display/screen_position_controller.cc @@ -63,7 +63,7 @@ void MoveAllTransientChildrenToNewRoot(const gfx::Display& display, // function usually returns |window->GetRootWindow()|, but if the mouse pointer // is moved outside the |window|'s root while the mouse is captured, it returns // the other root window. -std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow( +std::pair<aura::Window*, gfx::Point> GetRootWindowRelativeToWindow( aura::Window* window, const gfx::Point& location) { aura::Window* root_window = window->GetRootWindow(); @@ -111,7 +111,7 @@ std::pair<aura::RootWindow*, gfx::Point> GetRootWindowRelativeToWindow( // TODO(yusukes): Support non-X11 platforms if necessary. #endif - return std::make_pair(root_window->GetDispatcher(), location_in_root); + return std::make_pair(root_window, location_in_root); } } // namespace @@ -143,7 +143,7 @@ void ScreenPositionController::ConvertHostPointToScreen( gfx::Point* point) { aura::Window* root = root_window->GetRootWindow(); root->GetDispatcher()->ConvertPointFromHost(point); - std::pair<aura::RootWindow*, gfx::Point> pair = + std::pair<aura::Window*, gfx::Point> pair = GetRootWindowRelativeToWindow(root, *point); *point = pair.second; ConvertPointToScreen(pair.first, point); @@ -202,7 +202,7 @@ void ScreenPositionController::SetBounds(aura::Window* window, aura::client::GetFocusClient(window)->FocusWindow(focused); // TODO(beng): replace with GetRootWindow(). ash::Shell::GetInstance()->set_target_root_window( - focused->GetDispatcher()); + focused->GetRootWindow()); } else if (tracker.Contains(active)) { activation_client->ActivateWindow(active); } diff --git a/ash/display/virtual_keyboard_window_controller.cc b/ash/display/virtual_keyboard_window_controller.cc index 111ce3a..098c3ce 100644 --- a/ash/display/virtual_keyboard_window_controller.cc +++ b/ash/display/virtual_keyboard_window_controller.cc @@ -38,7 +38,7 @@ void VirtualKeyboardWindowController::UpdateWindow( CreateRootWindowHost(bounds_in_native); aura::RootWindow* root_window = new aura::RootWindow(params); - root_window->SetName( + root_window->window()->SetName( base::StringPrintf("VirtualKeyboardRootWindow-%d", virtual_keyboard_root_window_count++)); @@ -46,21 +46,24 @@ void VirtualKeyboardWindowController::UpdateWindow( // the DisplayController object outlives RootWindow objects. root_window->AddRootWindowObserver( Shell::GetInstance()->display_controller()); - InitRootWindowSettings(root_window)->display_id = display_info.id(); + InitRootWindowSettings(root_window->window())->display_id = + display_info.id(); root_window->Init(); RootWindowController::CreateForVirtualKeyboardDisplay(root_window); - root_window_controller_.reset(GetRootWindowController(root_window)); - root_window_controller_->root_window()->ShowRootWindow(); + root_window_controller_.reset(GetRootWindowController( + root_window->window())); + root_window_controller_->dispatcher()->ShowRootWindow(); } else { - aura::RootWindow* root_window = root_window_controller_->root_window(); - GetRootWindowSettings(root_window)->display_id = display_info.id(); + aura::RootWindow* root_window = root_window_controller_->dispatcher(); + GetRootWindowSettings(root_window->window())->display_id = + display_info.id(); root_window->SetHostBounds(display_info.bounds_in_native()); } } void VirtualKeyboardWindowController::Close() { if (root_window_controller_.get()) { - root_window_controller_->root_window()->RemoveRootWindowObserver( + root_window_controller_->dispatcher()->RemoveRootWindowObserver( Shell::GetInstance()->display_controller()); root_window_controller_->Shutdown(); root_window_controller_.reset(); diff --git a/ash/high_contrast/high_contrast_controller.cc b/ash/high_contrast/high_contrast_controller.cc index 72fe036..487c41b 100644 --- a/ash/high_contrast/high_contrast_controller.cc +++ b/ash/high_contrast/high_contrast_controller.cc @@ -25,7 +25,7 @@ void HighContrastController::SetEnabled(bool enabled) { } } -void HighContrastController::OnRootWindowAdded(aura::RootWindow* root_window) { +void HighContrastController::OnRootWindowAdded(aura::Window* root_window) { UpdateDisplay(root_window); } diff --git a/ash/high_contrast/high_contrast_controller.h b/ash/high_contrast/high_contrast_controller.h index e42e46c..49aca61 100644 --- a/ash/high_contrast/high_contrast_controller.h +++ b/ash/high_contrast/high_contrast_controller.h @@ -25,7 +25,7 @@ class ASH_EXPORT HighContrastController { void SetEnabled(bool enabled); // Update high contrast mode on the just added display. - void OnRootWindowAdded(aura::RootWindow* root_window); + void OnRootWindowAdded(aura::Window* root_window); private: // Update high contrast mode on the passed display. diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 1e734a6..3cfb6d2 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -283,19 +283,19 @@ void RootWindowController::Shutdown() { // being removed triggers a relayout of the shelf it will try to build a // window list adding windows from the target root window's containers which // may have already gone away. - if (Shell::GetTargetRootWindow() == root_window_.get()) { + if (Shell::GetTargetRootWindow() == root_window()) { Shell::GetInstance()->set_target_root_window( - Shell::GetPrimaryRootWindow() == root_window_.get() ? + Shell::GetPrimaryRootWindow() == root_window() ? NULL : Shell::GetPrimaryRootWindow()); } CloseChildWindows(); - GetRootWindowSettings(root_window_.get())->controller = NULL; + GetRootWindowSettings(root_window())->controller = NULL; screen_dimmer_.reset(); workspace_controller_.reset(); // Forget with the display ID so that display lookup // ends up with invalid display. - internal::GetRootWindowSettings(root_window_.get())->display_id = + internal::GetRootWindowSettings(root_window())->display_id = gfx::Display::kInvalidDisplayID; // And this root window should no longer process events. root_window_->PrepareForShutdown(); @@ -324,11 +324,11 @@ RootWindowController::GetSystemModalLayoutManager(aura::Window* window) { } aura::Window* RootWindowController::GetContainer(int container_id) { - return root_window_->GetChildById(container_id); + return root_window()->GetChildById(container_id); } const aura::Window* RootWindowController::GetContainer(int container_id) const { - return root_window_->GetChildById(container_id); + return root_window_->window()->GetChildById(container_id); } void RootWindowController::ShowLauncher() { @@ -413,7 +413,7 @@ void RootWindowController::CloseChildWindows() { docked_layout_manager_ = NULL; } - aura::client::SetDragDropClient(root_window_.get(), NULL); + aura::client::SetDragDropClient(root_window(), NULL); // TODO(harrym): Remove when Status Area Widget is a child view. if (shelf_) { @@ -428,12 +428,12 @@ void RootWindowController::CloseChildWindows() { animating_wallpaper_controller_.reset(); workspace_controller_.reset(); - aura::client::SetTooltipClient(root_window_.get(), NULL); + aura::client::SetTooltipClient(root_window(), NULL); // Explicitly destroy top level windows. We do this as during part of // destruction such windows may query the RootWindow for state. std::queue<aura::Window*> non_toplevel_windows; - non_toplevel_windows.push(root_window_.get()); + non_toplevel_windows.push(root_window()); while (!non_toplevel_windows.empty()) { aura::Window* non_toplevel_window = non_toplevel_windows.front(); non_toplevel_windows.pop(); @@ -451,12 +451,12 @@ void RootWindowController::CloseChildWindows() { delete *toplevel_windows.windows().begin(); } // And then remove the containers. - while (!root_window_->children().empty()) { - aura::Window* window = root_window_->children()[0]; + while (!root_window()->children().empty()) { + aura::Window* window = root_window()->children()[0]; if (window->owned_by_parent()) { delete window; } else { - root_window_->RemoveChild(window); + root_window()->RemoveChild(window); } } @@ -467,7 +467,7 @@ void RootWindowController::MoveWindowsTo(aura::Window* dst) { // Forget the shelf early so that shelf don't update itself using wrong // display info. workspace_controller_->SetShelf(NULL); - ReparentAllWindows(root_window_.get(), dst); + ReparentAllWindows(root_window(), dst); } ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() { @@ -568,17 +568,19 @@ RootWindowController::RootWindowController(aura::RootWindow* root_window) panel_layout_manager_(NULL), touch_hud_debug_(NULL), touch_hud_projection_(NULL) { - GetRootWindowSettings(root_window)->controller = this; - screen_dimmer_.reset(new ScreenDimmer(root_window)); + GetRootWindowSettings(root_window_->window())->controller = this; + screen_dimmer_.reset(new ScreenDimmer(root_window_->window())); stacking_controller_.reset(new StackingController); - aura::client::SetWindowTreeClient(root_window, stacking_controller_.get()); - capture_client_.reset(new views::corewm::ScopedCaptureClient(root_window)); + aura::client::SetWindowTreeClient(root_window_->window(), + stacking_controller_.get()); + capture_client_.reset( + new views::corewm::ScopedCaptureClient(root_window_->window())); } void RootWindowController::Init(RootWindowType root_window_type, bool first_run_after_boot) { - Shell::GetInstance()->InitRootWindow(root_window_.get()); + Shell::GetInstance()->InitRootWindow(root_window()); root_window_->SetCursor(ui::kCursorPointer); CreateContainersInRootWindow(root_window_.get()); @@ -604,8 +606,7 @@ void RootWindowController::Init(RootWindowType root_window_type, shell->InitKeyboard(this); } else { root_window_layout()->OnWindowResized(); - shell->desktop_background_controller()->OnRootWindowAdded( - root_window_.get()); + shell->desktop_background_controller()->OnRootWindowAdded(root_window()); shell->high_contrast_controller()->OnRootWindowAdded(root_window_.get()); root_window_->ShowRootWindow(); @@ -616,9 +617,8 @@ void RootWindowController::Init(RootWindowType root_window_type, } void RootWindowController::InitLayoutManagers() { - root_window_layout_ = - new RootWindowLayoutManager(root_window_.get()); - root_window_->SetLayoutManager(root_window_layout_); + root_window_layout_ = new RootWindowLayoutManager(root_window()); + root_window()->SetLayoutManager(root_window_layout_); aura::Window* default_container = GetContainer(kShellWindowId_DefaultContainer); @@ -679,7 +679,7 @@ void RootWindowController::InitLayoutManagers() { void RootWindowController::InitTouchHuds() { CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kAshTouchHud)) - set_touch_hud_debug(new TouchHudDebug(root_window_.get())); + set_touch_hud_debug(new TouchHudDebug(root_window())); if (Shell::GetInstance()->is_touch_hud_projection_enabled()) EnableTouchHudProjection(); } @@ -692,7 +692,7 @@ void RootWindowController::CreateSystemBackground( color = kChromeOsBootColor; #endif system_background_.reset( - new SystemBackgroundController(root_window_.get(), color)); + new SystemBackgroundController(root_window(), color)); #if defined(OS_CHROMEOS) // Make a copy of the system's boot splash screen so we can composite it @@ -707,7 +707,7 @@ void RootWindowController::CreateSystemBackground( } void RootWindowController::CreateContainersInRootWindow( - aura::RootWindow* root_window) { + aura::Window* root_window) { // These containers are just used by PowerButtonController to animate groups // of containers simultaneously without messing up the current transformations // on those containers. These are direct children of the root window; all of @@ -884,7 +884,7 @@ void RootWindowController::CreateContainersInRootWindow( void RootWindowController::EnableTouchHudProjection() { if (touch_hud_projection_) return; - set_touch_hud_projection(new TouchHudProjection(root_window_.get())); + set_touch_hud_projection(new TouchHudProjection(root_window())); } void RootWindowController::DisableTouchHudProjection() { diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h index fa8172f..980bf1e 100644 --- a/ash/root_window_controller.h +++ b/ash/root_window_controller.h @@ -13,13 +13,13 @@ #include "ash/system/user/login_status.h" #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" +#include "ui/aura/root_window.h" #include "ui/base/ui_base_types.h" class SkBitmap; namespace aura { class EventFilter; -class RootWindow; class Window; } @@ -102,7 +102,8 @@ class ASH_EXPORT RootWindowController : public ShellObserver { virtual ~RootWindowController(); - aura::RootWindow* root_window() { return root_window_.get(); } + aura::Window* root_window() { return dispatcher()->window(); } + aura::WindowEventDispatcher* dispatcher() { return root_window_.get(); } RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } @@ -245,7 +246,7 @@ class ASH_EXPORT RootWindowController : public ShellObserver { // Creates each of the special window containers that holds windows of various // types in the shell UI. - void CreateContainersInRootWindow(aura::RootWindow* root_window); + void CreateContainersInRootWindow(aura::Window* root_window); // Enables projection touch HUD. void EnableTouchHudProjection(); diff --git a/ash/shell.cc b/ash/shell.cc index 63f15d2..e25182f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -939,7 +939,7 @@ void Shell::InitKeyboard(internal::RootWindowController* root) { } } -void Shell::InitRootWindow(aura::RootWindow* root_window) { +void Shell::InitRootWindow(aura::Window* root_window) { DCHECK(activation_client_); DCHECK(visibility_controller_.get()); DCHECK(drag_drop_controller_.get()); diff --git a/ash/shell.h b/ash/shell.h index 583e50c..8d8e3bb 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -543,7 +543,7 @@ class ASH_EXPORT Shell void InitKeyboard(internal::RootWindowController* root); // Initializes the root window so that it can host browser windows. - void InitRootWindow(aura::RootWindow* root_window); + void InitRootWindow(aura::Window* root_window); // ash::internal::SystemModalContainerEventFilterDelegate overrides: virtual bool CanWindowReceiveEvents(aura::Window* window) OVERRIDE; diff --git a/ash/shell/window_watcher.cc b/ash/shell/window_watcher.cc index ea60dbc..ed3b0f0 100644 --- a/ash/shell/window_watcher.cc +++ b/ash/shell/window_watcher.cc @@ -49,7 +49,7 @@ class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver { container->children()[i]->AddObserver(watcher_); } - void RootWindowRemoved(aura::RootWindow* root) { + void RootWindowRemoved(aura::Window* root) { aura::Window* panel_container = ash::Shell::GetContainer( root, internal::kShellWindowId_PanelContainer); @@ -81,7 +81,7 @@ WindowWatcher::~WindowWatcher() { aura::Window::Windows root_windows = Shell::GetAllRootWindows(); for (aura::Window::Windows::iterator iter = root_windows.begin(); iter != root_windows.end(); ++ iter) { - workspace_window_watcher_->RootWindowRemoved((*iter)->GetDispatcher()); + workspace_window_watcher_->RootWindowRemoved(*iter); } } diff --git a/ash/touch/touch_hud_debug.cc b/ash/touch/touch_hud_debug.cc index 019779d..32392ff 100644 --- a/ash/touch/touch_hud_debug.cc +++ b/ash/touch/touch_hud_debug.cc @@ -329,7 +329,7 @@ class TouchHudCanvas : public views::View { DISALLOW_COPY_AND_ASSIGN(TouchHudCanvas); }; -TouchHudDebug::TouchHudDebug(aura::RootWindow* initial_root) +TouchHudDebug::TouchHudDebug(aura::Window* initial_root) : TouchObserverHUD(initial_root), mode_(FULLSCREEN), touch_log_(new TouchLog()), diff --git a/ash/touch/touch_hud_debug.h b/ash/touch/touch_hud_debug.h index a02a888..dbda29d 100644 --- a/ash/touch/touch_hud_debug.h +++ b/ash/touch/touch_hud_debug.h @@ -34,7 +34,7 @@ class ASH_EXPORT TouchHudDebug : public TouchObserverHUD { INVISIBLE, }; - explicit TouchHudDebug(aura::RootWindow* initial_root); + explicit TouchHudDebug(aura::Window* initial_root); // Returns the log of touch events for all displays as a dictionary mapping id // of each display to its touch log. diff --git a/ash/touch/touch_hud_projection.cc b/ash/touch/touch_hud_projection.cc index 173cbd0..615a372 100644 --- a/ash/touch/touch_hud_projection.cc +++ b/ash/touch/touch_hud_projection.cc @@ -137,7 +137,7 @@ class TouchPointView : public views::View, DISALLOW_COPY_AND_ASSIGN(TouchPointView); }; -TouchHudProjection::TouchHudProjection(aura::RootWindow* initial_root) +TouchHudProjection::TouchHudProjection(aura::Window* initial_root) : TouchObserverHUD(initial_root) { } diff --git a/ash/touch/touch_hud_projection.h b/ash/touch/touch_hud_projection.h index 197482de6..59e86c8 100644 --- a/ash/touch/touch_hud_projection.h +++ b/ash/touch/touch_hud_projection.h @@ -18,7 +18,7 @@ class TouchPointView; // of TouchObserverHUD, objects of this class manage their own lifetime. class TouchHudProjection : public TouchObserverHUD { public: - explicit TouchHudProjection(aura::RootWindow* initial_root); + explicit TouchHudProjection(aura::Window* initial_root); // Overriden from TouchObserverHUD. virtual void Clear() OVERRIDE; diff --git a/ash/touch/touch_observer_hud.cc b/ash/touch/touch_observer_hud.cc index 0af6c67..ff66e2c 100644 --- a/ash/touch/touch_observer_hud.cc +++ b/ash/touch/touch_observer_hud.cc @@ -18,7 +18,7 @@ namespace ash { namespace internal { -TouchObserverHUD::TouchObserverHUD(aura::RootWindow* initial_root) +TouchObserverHUD::TouchObserverHUD(aura::Window* initial_root) : display_id_(GetRootWindowSettings(initial_root)->display_id), root_window_(initial_root), widget_(NULL) { diff --git a/ash/touch/touch_observer_hud.h b/ash/touch/touch_observer_hud.h index 1a903e0..4e74e76 100644 --- a/ash/touch/touch_observer_hud.h +++ b/ash/touch/touch_observer_hud.h @@ -43,7 +43,7 @@ class ASH_EXPORT TouchObserverHUD int64 display_id() const { return display_id_; } protected: - explicit TouchObserverHUD(aura::RootWindow* initial_root); + explicit TouchObserverHUD(aura::Window* initial_root); virtual ~TouchObserverHUD(); diff --git a/ash/wm/root_window_layout_manager.cc b/ash/wm/root_window_layout_manager.cc index 16620f6..ef1689e 100644 --- a/ash/wm/root_window_layout_manager.cc +++ b/ash/wm/root_window_layout_manager.cc @@ -40,8 +40,8 @@ void RootWindowLayoutManager::OnWindowResized() { for (j = (*i)->children().begin(); j != (*i)->children().end(); ++j) (*j)->SetBounds(fullscreen_bounds); } - RootWindowController* root_window_controller = GetRootWindowController( - static_cast<aura::RootWindow*>(owner_)); + RootWindowController* root_window_controller = + GetRootWindowController(owner_); DesktopBackgroundWidgetController* background = root_window_controller->wallpaper_controller(); diff --git a/ash/wm/screen_dimmer.cc b/ash/wm/screen_dimmer.cc index 101d69b..b12566e 100644 --- a/ash/wm/screen_dimmer.cc +++ b/ash/wm/screen_dimmer.cc @@ -25,7 +25,7 @@ const int kDimmingTransitionMs = 200; } // namespace -ScreenDimmer::ScreenDimmer(aura::RootWindow* root_window) +ScreenDimmer::ScreenDimmer(aura::Window* root_window) : root_window_(root_window), currently_dimming_(false) { root_window_->AddObserver(this); diff --git a/ash/wm/screen_dimmer.h b/ash/wm/screen_dimmer.h index 476c274..abbb0a5 100644 --- a/ash/wm/screen_dimmer.h +++ b/ash/wm/screen_dimmer.h @@ -11,10 +11,6 @@ #include "base/memory/scoped_ptr.h" #include "ui/aura/window_observer.h" -namespace aura { -class RootWindow; -} - namespace ui { class Layer; } @@ -43,7 +39,7 @@ class ASH_EXPORT ScreenDimmer : public aura::WindowObserver { DISALLOW_COPY_AND_ASSIGN(TestApi); }; - explicit ScreenDimmer(aura::RootWindow* root_window); + explicit ScreenDimmer(aura::Window* root_window); virtual ~ScreenDimmer(); // Dim or undim the root window. @@ -57,7 +53,7 @@ class ASH_EXPORT ScreenDimmer : public aura::WindowObserver { private: friend class TestApi; - aura::RootWindow* root_window_; + aura::Window* root_window_; // Partially-opaque layer that's stacked above all of the root window's // children and used to dim the screen. NULL until the first time we dim. diff --git a/ash/wm/system_background_controller.cc b/ash/wm/system_background_controller.cc index fd6e8ec..7e4054e 100644 --- a/ash/wm/system_background_controller.cc +++ b/ash/wm/system_background_controller.cc @@ -4,7 +4,7 @@ #include "ash/wm/system_background_controller.h" -#include "ui/aura/root_window.h" +#include "ui/aura/window.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_type.h" @@ -12,7 +12,7 @@ namespace ash { namespace internal { SystemBackgroundController::SystemBackgroundController( - aura::RootWindow* root_window, + aura::Window* root_window, SkColor color) : root_window_(root_window), layer_(new ui::Layer(ui::LAYER_SOLID_COLOR)) { diff --git a/ash/wm/system_background_controller.h b/ash/wm/system_background_controller.h index 3638264..8d74cdd 100644 --- a/ash/wm/system_background_controller.h +++ b/ash/wm/system_background_controller.h @@ -13,10 +13,6 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/aura/window_observer.h" -namespace aura { -class RootWindow; -} - namespace ui { class Layer; } @@ -32,7 +28,7 @@ namespace internal { // It should never be transformed or restacked. class SystemBackgroundController : public aura::WindowObserver { public: - SystemBackgroundController(aura::RootWindow* root_window, SkColor color); + SystemBackgroundController(aura::Window* root_window, SkColor color); virtual ~SystemBackgroundController(); void SetColor(SkColor color); @@ -45,7 +41,7 @@ class SystemBackgroundController : public aura::WindowObserver { private: class HostContentLayerDelegate; - aura::RootWindow* root_window_; // not owned + aura::Window* root_window_; // not owned scoped_ptr<ui::Layer> layer_; |