summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc2
-rw-r--r--chrome/browser/chromeos/options/network_config_view.cc6
-rw-r--r--chrome/browser/fullscreen_chromeos.cc4
-rw-r--r--chrome/browser/fullscreen_win.cc2
-rw-r--r--chrome/browser/notifications/fullscreen_notification_blocker.cc3
-rw-r--r--chrome/browser/renderer_host/pepper/pepper_talk_host.cc2
-rw-r--r--chrome/browser/ui/views/apps/native_app_window_views.cc7
-rw-r--r--chrome/browser/ui/window_sizer/window_sizer_ash.cc6
-rw-r--r--chrome/browser/ui/window_sizer/window_sizer_ash_uitest.cc12
-rw-r--r--chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc10
10 files changed, 28 insertions, 26 deletions
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,