diff options
33 files changed, 79 insertions, 78 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 872b313..b07859c 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -592,7 +592,7 @@ bool AcceleratorController::PerformAction(int action, return true; case TOUCH_HUD_CLEAR: { internal::RootWindowController* controller = - internal::RootWindowController::ForActiveRootWindow(); + internal::RootWindowController::ForTargetRootWindow(); if (controller->touch_hud_debug()) { controller->touch_hud_debug()->Clear(); return true; @@ -601,7 +601,7 @@ bool AcceleratorController::PerformAction(int action, } case TOUCH_HUD_MODE_CHANGE: { internal::RootWindowController* controller = - internal::RootWindowController::ForActiveRootWindow(); + internal::RootWindowController::ForTargetRootWindow(); if (controller->touch_hud_debug()) { controller->touch_hud_debug()->ChangeToNextMode(); return true; @@ -743,7 +743,7 @@ bool AcceleratorController::PerformAction(int action, break; case SHOW_SYSTEM_TRAY_BUBBLE: { internal::RootWindowController* controller = - internal::RootWindowController::ForActiveRootWindow(); + internal::RootWindowController::ForTargetRootWindow(); if (!controller->GetSystemTray()->HasSystemBubble()) { controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); return true; @@ -752,7 +752,7 @@ bool AcceleratorController::PerformAction(int action, } case SHOW_MESSAGE_CENTER_BUBBLE: { internal::RootWindowController* controller = - internal::RootWindowController::ForActiveRootWindow(); + internal::RootWindowController::ForTargetRootWindow(); internal::StatusAreaWidget* status_area_widget = controller->shelf()->status_area_widget(); if (status_area_widget) { diff --git a/ash/accelerators/exit_warning_handler.cc b/ash/accelerators/exit_warning_handler.cc index 864286b..6ea635a 100644 --- a/ash/accelerators/exit_warning_handler.cc +++ b/ash/accelerators/exit_warning_handler.cc @@ -165,7 +165,7 @@ void ExitWarningHandler::CancelTimer() { void ExitWarningHandler::Show() { if (widget_) return; - aura::RootWindow* root_window = Shell::GetActiveRootWindow(); + aura::RootWindow* root_window = Shell::GetTargetRootWindow(); ExitWarningWidgetDelegateView* delegate = new ExitWarningWidgetDelegateView; gfx::Size rs = root_window->bounds().size(); gfx::Size ps = delegate->GetPreferredSize(); diff --git a/ash/display/screen_position_controller.cc b/ash/display/screen_position_controller.cc index 8c37efe..b416d38 100644 --- a/ash/display/screen_position_controller.cc +++ b/ash/display/screen_position_controller.cc @@ -197,7 +197,7 @@ void ScreenPositionController::SetBounds(aura::Window* window, // Restore focused/active window. if (tracker.Contains(focused)) { aura::client::GetFocusClient(window)->FocusWindow(focused); - ash::Shell::GetInstance()->set_active_root_window( + ash::Shell::GetInstance()->set_target_root_window( focused->GetRootWindow()); } else if (tracker.Contains(active)) { activation_client->ActivateWindow(active); diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc index c0a9e91..1c485b3 100644 --- a/ash/drag_drop/drag_drop_tracker_unittest.cc +++ b/ash/drag_drop/drag_drop_tracker_unittest.cc @@ -77,7 +77,7 @@ TEST_F(DragDropTrackerTest, MAYBE_GetTarget) { EXPECT_EQ("300,100 100x100", window1->GetBoundsInScreen().ToString()); // Make RootWindow0 active so that capture window is parented to it. - Shell::GetInstance()->set_active_root_window(root_windows[0]); + Shell::GetInstance()->set_target_root_window(root_windows[0]); // Start tracking from the RootWindow1 and check the point on RootWindow0 that // |window0| covers. @@ -98,7 +98,7 @@ TEST_F(DragDropTrackerTest, MAYBE_GetTarget) { EXPECT_NE(window1.get(), GetTarget(gfx::Point(50, 250))); // Make RootWindow1 active so that capture window is parented to it. - Shell::GetInstance()->set_active_root_window(root_windows[1]); + Shell::GetInstance()->set_target_root_window(root_windows[1]); // Start tracking from the RootWindow1 and check the point on RootWindow0 that // |window0| covers. @@ -140,7 +140,7 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertEvent) { window1->Show(); // Make RootWindow0 active so that capture window is parented to it. - Shell::GetInstance()->set_active_root_window(root_windows[0]); + Shell::GetInstance()->set_target_root_window(root_windows[0]); // Start tracking from the RootWindow0 and converts the mouse event into // |window0|'s coodinates. @@ -169,7 +169,7 @@ TEST_F(DragDropTrackerTest, MAYBE_ConvertEvent) { EXPECT_EQ(original01.flags(), converted01->flags()); // Make RootWindow1 active so that capture window is parented to it. - Shell::GetInstance()->set_active_root_window(root_windows[1]); + Shell::GetInstance()->set_target_root_window(root_windows[1]); // Start tracking from the RootWindow1 and converts the mouse event into // |window0|'s coodinates. diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc index 31dbd15..f0719d0 100644 --- a/ash/extended_desktop_unittest.cc +++ b/ash/extended_desktop_unittest.cc @@ -222,7 +222,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) { views::Widget* widget_on_1st = CreateTestWidget(gfx::Rect(10, 10, 100, 100)); EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); EXPECT_EQ(root_windows[0], widget_on_1st->GetNativeView()->GetRootWindow()); - EXPECT_EQ(root_windows[0], Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], Shell::GetTargetRootWindow()); // Open system modal. Make sure it's on 2nd root window and active. views::Widget* modal_widget = views::Widget::CreateWindowWithContextAndBounds( @@ -232,7 +232,7 @@ TEST_F(ExtendedDesktopTest, SystemModal) { modal_widget->Show(); EXPECT_TRUE(wm::IsActiveWindow(modal_widget->GetNativeView())); EXPECT_EQ(root_windows[1], modal_widget->GetNativeView()->GetRootWindow()); - EXPECT_EQ(root_windows[1], Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[1], Shell::GetTargetRootWindow()); aura::test::EventGenerator& event_generator(GetEventGenerator()); @@ -240,14 +240,14 @@ TEST_F(ExtendedDesktopTest, SystemModal) { event_generator.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); event_generator.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(modal_widget->GetNativeView())); - EXPECT_EQ(root_windows[1], Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[1], Shell::GetTargetRootWindow()); // Close system modal and so clicking a widget should work now. modal_widget->Close(); event_generator.MoveMouseToCenterOf(widget_on_1st->GetNativeView()); event_generator.ClickLeftButton(); EXPECT_TRUE(wm::IsActiveWindow(widget_on_1st->GetNativeView())); - EXPECT_EQ(root_windows[0], Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], Shell::GetTargetRootWindow()); } TEST_F(ExtendedDesktopTest, TestCursor) { diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc index d3119ed..e796d182 100644 --- a/ash/magnifier/magnification_controller.cc +++ b/ash/magnifier/magnification_controller.cc @@ -456,14 +456,14 @@ void MagnificationControllerImpl::OnWindowDestroying( // destroyed before the root windows get destroyed. DCHECK(root_window); - aura::RootWindow* active_root_window = Shell::GetActiveRootWindow(); - CHECK(active_root_window); + aura::RootWindow* target_root_window = Shell::GetTargetRootWindow(); + CHECK(target_root_window); - // The destroyed root window must not be active. - CHECK_NE(active_root_window, root_window); + // The destroyed root window must not be target. + CHECK_NE(target_root_window, root_window); // Don't redraw the old root window as it's being destroyed. - SwitchTargetRootWindow(active_root_window, false); - point_of_interest_ = active_root_window->bounds().CenterPoint(); + SwitchTargetRootWindow(target_root_window, false); + point_of_interest_ = target_root_window->bounds().CenterPoint(); } } diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc index 7e19815..51fc711 100644 --- a/ash/root_window_controller.cc +++ b/ash/root_window_controller.cc @@ -244,8 +244,8 @@ RootWindowController* RootWindowController::ForWindow( } // static -RootWindowController* RootWindowController::ForActiveRootWindow() { - return internal::GetRootWindowController(Shell::GetActiveRootWindow()); +RootWindowController* RootWindowController::ForTargetRootWindow() { + return internal::GetRootWindowController(Shell::GetTargetRootWindow()); } void RootWindowController::SetWallpaperController( @@ -268,12 +268,12 @@ void RootWindowController::Shutdown() { wallpaper_controller_.reset(); animating_wallpaper_controller_.reset(); - // Change the active root window before closing child windows. If any child + // Change the target root window before closing child windows. If any child // being removed triggers a relayout of the shelf it will try to build a - // window list adding windows from the active root window's containers which + // window list adding windows from the target root window's containers which // may have already gone away. - if (Shell::GetActiveRootWindow() == root_window_) { - Shell::GetInstance()->set_active_root_window( + if (Shell::GetTargetRootWindow() == root_window_) { + Shell::GetInstance()->set_target_root_window( Shell::GetPrimaryRootWindow() == root_window_.get() ? NULL : Shell::GetPrimaryRootWindow()); } diff --git a/ash/root_window_controller.h b/ash/root_window_controller.h index 8bdbdb2..a3d99a3 100644 --- a/ash/root_window_controller.h +++ b/ash/root_window_controller.h @@ -87,8 +87,8 @@ class ASH_EXPORT RootWindowController : public ShellObserver { // Returns a RootWindowController of the window's root window. static RootWindowController* ForWindow(const aura::Window* window); - // Returns the RootWindowController of the active root window. - static internal::RootWindowController* ForActiveRootWindow(); + // Returns the RootWindowController of the target root window. + static internal::RootWindowController* ForTargetRootWindow(); aura::RootWindow* root_window() { return root_window_.get(); } diff --git a/ash/shell.cc b/ash/shell.cc index badb7e4..45af8df 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -385,7 +385,7 @@ aura::RootWindow* Shell::GetPrimaryRootWindow() { } // static -aura::RootWindow* Shell::GetActiveRootWindow() { +aura::RootWindow* Shell::GetTargetRootWindow() { Shell* shell = GetInstance(); if (shell->scoped_target_root_window_) return shell->scoped_target_root_window_; @@ -656,9 +656,9 @@ void Shell::ShowContextMenu(const gfx::Point& location_in_screen, } void Shell::ToggleAppList(aura::Window* window) { - // If the context window is not given, show it on the active root window. + // If the context window is not given, show it on the target root window. if (!window) - window = GetActiveRootWindow(); + window = GetTargetRootWindow(); if (!app_list_controller_) app_list_controller_.reset(new internal::AppListController); app_list_controller_->SetVisible(!app_list_controller_->IsVisible(), window); diff --git a/ash/shell.h b/ash/shell.h index c4762ab7..e49a093 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -184,8 +184,7 @@ class ASH_EXPORT Shell // be overridden by using ScopedTargetRootWindow(). // If you want to get a RootWindow of the active window, just use // |wm::GetActiveWindow()->GetRootWindow()|. - // TODO(oshima): Rename to GetTargetRootWindow() crbug.com/266378. - static aura::RootWindow* GetActiveRootWindow(); + static aura::RootWindow* GetTargetRootWindow(); // Returns the global Screen object that's always active in ash. static gfx::Screen* GetScreen(); @@ -209,7 +208,7 @@ class ASH_EXPORT Shell // application windows to be maximized only. static bool IsForcedMaximizeMode(); - void set_active_root_window(aura::RootWindow* target_root_window) { + void set_target_root_window(aura::RootWindow* target_root_window) { target_root_window_ = target_root_window; } diff --git a/ash/shell/panel_window.cc b/ash/shell/panel_window.cc index 886d0c1..9593a40 100644 --- a/ash/shell/panel_window.cc +++ b/ash/shell/panel_window.cc @@ -47,7 +47,7 @@ views::Widget* PanelWindow::CreateWidget() { if (params().bounds.height() == 0) params().bounds.set_height(kDefaultHeight); params().bounds = ScreenAsh::ConvertRectToScreen( - Shell::GetActiveRootWindow(), + Shell::GetTargetRootWindow(), params().bounds); widget->Init(params()); diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc index b7391e3..71af9e5 100644 --- a/ash/test/ash_test_helper.cc +++ b/ash/test/ash_test_helper.cc @@ -117,7 +117,7 @@ void AshTestHelper::RunAllPendingInMessageLoop() { } aura::RootWindow* AshTestHelper::CurrentContext() { - aura::RootWindow* root_window = Shell::GetActiveRootWindow(); + aura::RootWindow* root_window = Shell::GetTargetRootWindow(); if (!root_window) root_window = Shell::GetPrimaryRootWindow(); DCHECK(root_window); diff --git a/ash/test/ui_controls_factory_ash.cc b/ash/test/ui_controls_factory_ash.cc index ab0c0cd..458a4cb 100644 --- a/ash/test/ui_controls_factory_ash.cc +++ b/ash/test/ui_controls_factory_ash.cc @@ -86,7 +86,7 @@ class UIControlsAsh : public UIControlsAura { bool command, const base::Closure& closure) OVERRIDE { aura::RootWindow* root = - window ? window->GetRootWindow() : ash::Shell::GetActiveRootWindow(); + window ? window->GetRootWindow() : ash::Shell::GetTargetRootWindow(); UIControlsAura* ui_controls = GetUIControlsForRootWindow(root); return ui_controls && ui_controls->SendKeyPressNotifyWhenDone( window, key, control, shift, alt, command, closure); @@ -131,7 +131,7 @@ class UIControlsAsh : public UIControlsAura { virtual void RunClosureAfterAllPendingUIEvents( const base::Closure& closure) OVERRIDE { UIControlsAura* ui_controls = GetUIControlsForRootWindow( - ash::Shell::GetActiveRootWindow()); + ash::Shell::GetTargetRootWindow()); if (ui_controls) ui_controls->RunClosureAfterAllPendingUIEvents(closure); } diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc index 0b5aa33..851dbba 100644 --- a/ash/wm/ash_focus_rules.cc +++ b/ash/wm/ash_focus_rules.cc @@ -107,7 +107,7 @@ aura::Window* AshFocusRules::GetNextActivatableWindow( // container. aura::RootWindow* root = ignore->GetRootWindow(); if (!root) - root = Shell::GetActiveRootWindow(); + root = Shell::GetTargetRootWindow(); int container_count = static_cast<int>(arraysize(kWindowContainerIds)); for (int i = 0; ignore && i < container_count; i++) { aura::Window* container = Shell::GetContainer(root, kWindowContainerIds[i]); diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc index 2e8648f..81aec45 100644 --- a/ash/wm/drag_window_resizer_unittest.cc +++ b/ash/wm/drag_window_resizer_unittest.cc @@ -224,7 +224,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysActiveRoot) { EXPECT_TRUE(ash::wm::CanActivateWindow(window.get())); ash::wm::ActivateWindow(window.get()); EXPECT_EQ(root_windows[0], window->GetRootWindow()); - EXPECT_EQ(root_windows[0], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); { // Grab (0, 0) of the window. scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer( @@ -237,7 +237,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysActiveRoot) { // The whole window is on the secondary display now. The parent should be // changed. EXPECT_EQ(root_windows[1], window->GetRootWindow()); - EXPECT_EQ(root_windows[1], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[1], ash::Shell::GetTargetRootWindow()); } } diff --git a/ash/wm/frame_painter_unittest.cc b/ash/wm/frame_painter_unittest.cc index 1bc6923..7790339 100644 --- a/ash/wm/frame_painter_unittest.cc +++ b/ash/wm/frame_painter_unittest.cc @@ -208,7 +208,7 @@ class FramePainterTest : public ash::test::AshTestBase { TEST_F(FramePainterTest, CreateAndDeleteSingleWindow) { // Ensure that creating/deleting a window works well and doesn't cause // crashes. See crbug.com/155634 - aura::RootWindow* root = Shell::GetActiveRootWindow(); + aura::RootWindow* root = Shell::GetTargetRootWindow(); scoped_ptr<Widget> widget(CreateTestWidget()); scoped_ptr<FramePainter> painter(CreateTestPainter(widget.get())); diff --git a/ash/wm/maximize_bubble_controller.cc b/ash/wm/maximize_bubble_controller.cc index ae108ca..68cbfd9 100644 --- a/ash/wm/maximize_bubble_controller.cc +++ b/ash/wm/maximize_bubble_controller.cc @@ -390,7 +390,7 @@ MaximizeBubbleController::Bubble::Bubble( // The window needs to be owned by the root so that the SnapSizer does not // cover it upon animation. aura::Window* parent = Shell::GetContainer( - Shell::GetActiveRootWindow(), + Shell::GetTargetRootWindow(), internal::kShellWindowId_ShelfContainer); set_parent_window(parent); diff --git a/ash/wm/mru_window_tracker.cc b/ash/wm/mru_window_tracker.cc index 8c90efb..869f8b5 100644 --- a/ash/wm/mru_window_tracker.cc +++ b/ash/wm/mru_window_tracker.cc @@ -41,7 +41,7 @@ MruWindowTracker::WindowList BuildWindowListInternal( MruWindowTracker::WindowList windows; Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); - aura::RootWindow* active_root = Shell::GetActiveRootWindow(); + aura::RootWindow* active_root = Shell::GetTargetRootWindow(); for (Shell::RootWindowList::const_iterator iter = root_windows.begin(); iter != root_windows.end(); ++iter) { if (*iter == active_root) diff --git a/ash/wm/overview/window_selector.cc b/ash/wm/overview/window_selector.cc index 847740c..a741afd 100644 --- a/ash/wm/overview/window_selector.cc +++ b/ash/wm/overview/window_selector.cc @@ -236,14 +236,14 @@ void WindowSelector::OnAttemptToReactivateWindow(aura::Window* request_active, void WindowSelector::StartOverview() { DCHECK(!window_overview_); window_overview_.reset(new WindowOverview(this, &windows_, - mode_ == CYCLE ? Shell::GetActiveRootWindow() : NULL)); + mode_ == CYCLE ? Shell::GetTargetRootWindow() : NULL)); if (mode_ == CYCLE) window_overview_->SetSelection(selected_window_); } void WindowSelector::RemoveFocusAndSetRestoreWindow() { aura::client::FocusClient* focus_client = aura::client::GetFocusClient( - Shell::GetActiveRootWindow()); + Shell::GetPrimaryRootWindow()); DCHECK(!restore_focus_window_); restore_focus_window_ = focus_client->GetFocusedWindow(); if (restore_focus_window_) { diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 3210259..2142f9a 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc @@ -92,7 +92,7 @@ class WindowSelectorTest : public test::AshTestBase { aura::Window* GetFocusedWindow() { return aura::client::GetFocusClient( - Shell::GetActiveRootWindow())->GetFocusedWindow(); + Shell::GetPrimaryRootWindow())->GetFocusedWindow(); } private: diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc index 51e13b3..d846c78 100644 --- a/ash/wm/stacking_controller.cc +++ b/ash/wm/stacking_controller.cc @@ -25,7 +25,7 @@ namespace { // return the active root window. aura::RootWindow* FindContainerRoot(const gfx::Rect& bounds) { if (bounds.x() == 0 && bounds.y() == 0 && bounds.IsEmpty()) - return Shell::GetActiveRootWindow(); + return Shell::GetTargetRootWindow(); return wm::GetRootWindowMatching(bounds); } diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc index 8e74543..7cb4bbc 100644 --- a/ash/wm/window_cycle_controller_unittest.cc +++ b/ash/wm/window_cycle_controller_unittest.cc @@ -328,7 +328,7 @@ TEST_F(WindowCycleControllerTest, AlwaysOnTopMultipleRootWindows) { WindowCycleController* controller = Shell::GetInstance()->window_cycle_controller(); - Shell::GetInstance()->set_active_root_window(root_windows[0]); + Shell::GetInstance()->set_target_root_window(root_windows[0]); // Create two windows in the primary root. scoped_ptr<Window> window0(CreateTestWindowInShellWithId(0)); @@ -341,7 +341,7 @@ TEST_F(WindowCycleControllerTest, AlwaysOnTopMultipleRootWindows) { EXPECT_EQ(root_windows[0], window1->GetRootWindow()); // And two on the secondary root. - Shell::GetInstance()->set_active_root_window(root_windows[1]); + Shell::GetInstance()->set_target_root_window(root_windows[1]); scoped_ptr<Window> window2(CreateTestWindowInShellWithId(2)); EXPECT_EQ(root_windows[1], window2->GetRootWindow()); @@ -353,7 +353,7 @@ TEST_F(WindowCycleControllerTest, AlwaysOnTopMultipleRootWindows) { EXPECT_EQ(root_windows[1], window3->GetRootWindow()); // Move the active root window to the secondary. - Shell::GetInstance()->set_active_root_window(root_windows[1]); + Shell::GetInstance()->set_target_root_window(root_windows[1]); wm::ActivateWindow(window2.get()); diff --git a/ash/wm/workspace/multi_window_resize_controller.cc b/ash/wm/workspace/multi_window_resize_controller.cc index c447b9c..597acbf 100644 --- a/ash/wm/workspace/multi_window_resize_controller.cc +++ b/ash/wm/workspace/multi_window_resize_controller.cc @@ -387,7 +387,7 @@ void MultiWindowResizeController::ShowNow() { params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; params.parent = Shell::GetContainer( - Shell::GetActiveRootWindow(), + Shell::GetTargetRootWindow(), internal::kShellWindowId_AlwaysOnTopContainer); params.can_activate = false; ResizeView* view = new ResizeView(this, windows_.direction); diff --git a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc index 54a6410..17b782b 100644 --- a/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc +++ b/chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc @@ -53,7 +53,7 @@ void CandidateWindowControllerImpl::CreateView() { params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; // Show the candidate window always on top params.parent = ash::Shell::GetContainer( - ash::Shell::GetActiveRootWindow(), + ash::Shell::GetTargetRootWindow(), ash::internal::kShellWindowId_InputMethodContainer); frame_->Init(params); diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index 60e618b..5d07db7 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -262,8 +262,10 @@ void NetworkConfigView::ShowDialog(gfx::NativeWindow parent) { if (parent == NULL) parent = GetDialogParent(); // Failed connections may result in a pop-up with no natural parent window, - // so provide a fallback context on the active display. - gfx::NativeWindow context = parent ? NULL : ash::Shell::GetActiveRootWindow(); + // so provide a fallback context on the primary display. This is necessary + // becase one of parent or context must be non NULL. + gfx::NativeWindow context = + parent ? NULL : ash::Shell::GetPrimaryRootWindow(); Widget* window = DialogDelegate::CreateDialogWidget(this, context, parent); window->SetAlwaysOnTop(true); window->Show(); diff --git a/chrome/browser/fullscreen_chromeos.cc b/chrome/browser/fullscreen_chromeos.cc index 448fdc1..acdeb04 100644 --- a/chrome/browser/fullscreen_chromeos.cc +++ b/chrome/browser/fullscreen_chromeos.cc @@ -7,7 +7,9 @@ #include "ash/root_window_controller.h" bool IsFullScreenMode() { + // TODO(oshima): Fullscreen is per display state. Investigate + // and fix if necessary. ash::internal::RootWindowController* controller = - ash::internal::RootWindowController::ForActiveRootWindow(); + ash::internal::RootWindowController::ForTargetRootWindow(); return controller && controller->GetTopmostFullscreenWindow(); } diff --git a/chrome/browser/fullscreen_win.cc b/chrome/browser/fullscreen_win.cc index 0c32210..6a3ef97 100644 --- a/chrome/browser/fullscreen_win.cc +++ b/chrome/browser/fullscreen_win.cc @@ -105,7 +105,7 @@ bool IsFullScreenMode() { #if defined(USE_ASH) if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH) { ash::internal::RootWindowController* controller = - ash::internal::RootWindowController::ForActiveRootWindow(); + ash::internal::RootWindowController::ForTargetRootWindow(); return controller && controller->GetTopmostFullscreenWindow(); } #endif diff --git a/chrome/browser/notifications/fullscreen_notification_blocker.cc b/chrome/browser/notifications/fullscreen_notification_blocker.cc index fd20e5e..8122b1f 100644 --- a/chrome/browser/notifications/fullscreen_notification_blocker.cc +++ b/chrome/browser/notifications/fullscreen_notification_blocker.cc @@ -24,8 +24,7 @@ bool DoesFullscreenModeBlockNotifications() { #if defined(USE_ASH) if (ash::Shell::HasInstance()) { ash::internal::RootWindowController* controller = - ash::internal::RootWindowController::ForWindow( - ash::Shell::GetActiveRootWindow()); + ash::internal::RootWindowController::ForTargetRootWindow(); const aura::Window* fullscreen_window = controller->GetTopmostFullscreenWindow(); diff --git a/chrome/browser/renderer_host/pepper/pepper_talk_host.cc b/chrome/browser/renderer_host/pepper/pepper_talk_host.cc index 3151e69..98f4b643 100644 --- a/chrome/browser/renderer_host/pepper/pepper_talk_host.cc +++ b/chrome/browser/renderer_host/pepper/pepper_talk_host.cc @@ -69,7 +69,7 @@ ppapi::host::ReplyMessageContext GetPermissionOnUIThread( // TODO(brettw). We should not be grabbing the active toplevel window, we // should use the toplevel window associated with the render view. aura::Window* parent = ash::Shell::GetContainer( - ash::Shell::GetActiveRootWindow(), + ash::Shell::GetTargetRootWindow(), ash::internal::kShellWindowId_SystemModalContainer); reply.params.set_result(static_cast<int32_t>( chrome::ShowMessageBox(parent, title, message, diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc index f014184..42da919 100644 --- a/chrome/browser/ui/views/apps/native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/native_app_window_views.cc @@ -262,11 +262,10 @@ void NativeAppWindowViews::InitializePanelWindow( preferred_size_.set_height(kMinPanelHeight); #if defined(USE_ASH) if (ash::Shell::HasInstance()) { - // Open a new panel on the active root window where - // a current active/focused window is on. - aura::RootWindow* active = ash::Shell::GetActiveRootWindow(); + // Open a new panel on the target root. + aura::RootWindow* target = ash::Shell::GetTargetRootWindow(); params.bounds = ash::ScreenAsh::ConvertRectToScreen( - active, gfx::Rect(preferred_size_)); + target, gfx::Rect(preferred_size_)); } else { params.bounds = gfx::Rect(preferred_size_); } diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc index 59a383c..f962fd6 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc @@ -106,14 +106,14 @@ void WindowSizer::GetTabbedBrowserBoundsAsh( GetDefaultWindowBoundsAsh(bounds_in_screen); } - aura::RootWindow* active = ash::Shell::GetActiveRootWindow(); + aura::RootWindow* target = ash::Shell::GetTargetRootWindow(); // Always open new window in the active display. gfx::Rect work_area = - screen_->GetDisplayMatching(active->GetBoundsInScreen()).work_area(); + screen_->GetDisplayMatching(target->GetBoundsInScreen()).work_area(); // This is a window / app. See if there is no window and try to place it. int count = GetNumberOfValidTopLevelBrowserWindows(work_area); - aura::Window* top_window = ash::GetTopWindowForNewWindow(active); + aura::Window* top_window = ash::GetTopWindowForNewWindow(target); // Our window should not have any impact if we are already on top. if (browser_->window() && top_window == browser_->window()->GetNativeWindow()) diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc index bdd8c3b..c57cb43 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc @@ -88,7 +88,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerTest, // Close the browser window so that clicking icon will create a new window. CloseBrowser(browser_list->get(0)); EXPECT_EQ(0u, browser_list->size()); - EXPECT_EQ(root_windows[0], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); OpenBrowserUsingShelfOnRootWindow(root_windows[1]); @@ -96,7 +96,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerTest, EXPECT_EQ(1u, browser_list->size()); EXPECT_EQ(root_windows[1], browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); - EXPECT_EQ(root_windows[1], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[1], ash::Shell::GetTargetRootWindow()); // Close the browser window so that clicking icon will create a new window. CloseBrowser(browser_list->get(0)); @@ -108,7 +108,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerTest, EXPECT_EQ(1u, browser_list->size()); EXPECT_EQ(root_windows[0], browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); - EXPECT_EQ(root_windows[0], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); // Balanced with the chrome::StartKeepAlive above. chrome::EndKeepAlive(); @@ -175,7 +175,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); EXPECT_EQ(1u, browser_list->size()); - EXPECT_EQ(root_windows[0], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); CloseBrowser(browser_list->get(0)); OpenBrowserUsingContextMenuOnRootWindow(root_windows[1]); @@ -184,7 +184,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, EXPECT_EQ(1u, browser_list->size()); EXPECT_EQ(root_windows[1], browser_list->get(0)->window()->GetNativeWindow()->GetRootWindow()); - EXPECT_EQ(root_windows[1], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[1], ash::Shell::GetTargetRootWindow()); OpenBrowserUsingContextMenuOnRootWindow(root_windows[0]); @@ -192,7 +192,7 @@ IN_PROC_BROWSER_TEST_F(WindowSizerContextMenuTest, EXPECT_EQ(2u, browser_list->size()); EXPECT_EQ(root_windows[0], browser_list->get(1)->window()->GetNativeWindow()->GetRootWindow()); - EXPECT_EQ(root_windows[0], ash::Shell::GetActiveRootWindow()); + EXPECT_EQ(root_windows[0], ash::Shell::GetTargetRootWindow()); // Balanced with the chrome::StartKeepAlive above. chrome::EndKeepAlive(); diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc index 2e1d65c..c5e1f5e 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc @@ -598,7 +598,7 @@ TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { GetPrimaryDisplay().bounds(); gfx::Rect secondary_bounds = ash::ScreenAsh::GetSecondaryDisplay().bounds(); - ash::Shell::GetInstance()->set_active_root_window( + ash::Shell::GetInstance()->set_target_root_window( ash::Shell::GetPrimaryRootWindow()); scoped_ptr<TestingProfile> profile(new TestingProfile()); @@ -610,7 +610,7 @@ TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { Browser::CreateParams(profile.get(), chrome::HOST_DESKTOP_TYPE_ASH))); browser_window->Show(); EXPECT_EQ(browser_window->GetNativeWindow()->GetRootWindow(), - ash::Shell::GetActiveRootWindow()); + ash::Shell::GetTargetRootWindow()); scoped_ptr<BrowserWindow> another_browser_window(CreateTestBrowserWindow( CreateTestWindowInShellWithId(1), @@ -627,7 +627,7 @@ TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { // Make sure the primary root is active. ASSERT_EQ(ash::Shell::GetPrimaryRootWindow(), - ash::Shell::GetActiveRootWindow()); + ash::Shell::GetTargetRootWindow()); // First new window should be in the primary. { @@ -652,7 +652,7 @@ TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { second_display); browser_window->Activate(); EXPECT_NE(ash::Shell::GetPrimaryRootWindow(), - ash::Shell::GetActiveRootWindow()); + ash::Shell::GetTargetRootWindow()); gfx::Rect window_bounds; GetWindowBounds(p1600x1200, p1600x1200, secondary_bounds, gfx::Rect(), secondary_bounds, @@ -669,7 +669,7 @@ TEST_F(WindowSizerAshTest, MAYBE_PlaceNewWindowsOnMultipleDisplays) { { another_browser_window->Activate(); EXPECT_EQ(ash::Shell::GetPrimaryRootWindow(), - ash::Shell::GetActiveRootWindow()); + ash::Shell::GetTargetRootWindow()); gfx::Rect window_bounds; GetWindowBounds(p1600x1200, p1600x1200, secondary_bounds, |