diff options
-rw-r--r-- | ash/ash.gyp | 2 | ||||
-rw-r--r-- | ash/shell.cc | 2 | ||||
-rw-r--r-- | ash/shell.h | 7 | ||||
-rw-r--r-- | ash/wm/window_positioner.cc (renamed from chrome/browser/ui/ash/window_positioner.cc) | 4 | ||||
-rw-r--r-- | ash/wm/window_positioner.h (renamed from chrome/browser/ui/ash/window_positioner.h) | 11 | ||||
-rw-r--r-- | chrome/browser/ui/ash/chrome_shell_delegate.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/ash/chrome_shell_delegate.h | 10 | ||||
-rw-r--r-- | chrome/browser/ui/ash/chrome_shell_delegate_views.cc | 1 | ||||
-rw-r--r-- | chrome/browser/ui/ash/window_positioner_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/window_sizer/window_sizer.cc | 6 | ||||
-rw-r--r-- | chrome/chrome_browser_ui.gypi | 2 |
11 files changed, 23 insertions, 28 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp index 7793fc0..aee601b 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -515,6 +515,8 @@ 'wm/window_cycle_controller.h', 'wm/window_cycle_list.cc', 'wm/window_cycle_list.h', + 'wm/window_positioner.cc', + 'wm/window_positioner.h', 'wm/window_state.cc', 'wm/window_state.h', 'wm/window_state_observer.h', diff --git a/ash/shell.cc b/ash/shell.cc index ccdbae2..8bbad04 100644 --- a/ash/shell.cc +++ b/ash/shell.cc @@ -70,6 +70,7 @@ #include "ash/wm/video_detector.h" #include "ash/wm/window_animations.h" #include "ash/wm/window_cycle_controller.h" +#include "ash/wm/window_positioner.h" #include "ash/wm/window_properties.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace_controller.h" @@ -162,6 +163,7 @@ Shell::Shell(ShellDelegate* delegate) target_root_window_(NULL), scoped_target_root_window_(NULL), delegate_(delegate), + window_positioner_(new WindowPositioner), activation_client_(NULL), #if defined(OS_CHROMEOS) && defined(USE_X11) output_configurator_(new chromeos::OutputConfigurator()), diff --git a/ash/shell.h b/ash/shell.h index ed007b9..74c6311 100644 --- a/ash/shell.h +++ b/ash/shell.h @@ -97,6 +97,7 @@ class UserWallpaperDelegate; class VideoDetector; class WebNotificationTray; class WindowCycleController; +class WindowPositioner; class WindowSelectorController; namespace internal { @@ -120,7 +121,6 @@ class OverlayEventFilter; class ResizeShadowController; class ResolutionNotificationController; class RootWindowController; -class RootWindowLayoutManager; class ScopedTargetRootWindow; class ScreenPositionController; class SlowAnimationEventFilter; @@ -473,6 +473,10 @@ class ASH_EXPORT Shell return launcher_model_.get(); } + WindowPositioner* window_positioner() { + return window_positioner_.get(); + } + // Returns the launcher delegate, creating if necesary. LauncherDelegate* GetLauncherDelegate(); @@ -551,6 +555,7 @@ class ASH_EXPORT Shell app_list_shelf_item_delegate_; scoped_ptr<LauncherModel> launcher_model_; + scoped_ptr<ash::WindowPositioner> window_positioner_; scoped_ptr<internal::AppListController> app_list_controller_; diff --git a/chrome/browser/ui/ash/window_positioner.cc b/ash/wm/window_positioner.cc index b11ebcd..1a7af44 100644 --- a/chrome/browser/ui/ash/window_positioner.cc +++ b/ash/wm/window_positioner.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/ash/window_positioner.h" +#include "ash/wm/window_positioner.h" #include "ash/shell.h" #include "ash/wm/mru_window_tracker.h" diff --git a/chrome/browser/ui/ash/window_positioner.h b/ash/wm/window_positioner.h index c3f758a..8a95b2e 100644 --- a/chrome/browser/ui/ash/window_positioner.h +++ b/ash/wm/window_positioner.h @@ -1,10 +1,11 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_UI_ASH_WINDOW_POSITIONER_H_ -#define CHROME_BROWSER_UI_ASH_WINDOW_POSITIONER_H_ +#ifndef ASH_WM_WINDOW_POSITIONER_H_ +#define ASH_WM_WINDOW_POSITIONER_H_ +#include "ash/ash_export.h" #include "base/basictypes.h" #include "ui/gfx/rect.h" @@ -20,7 +21,7 @@ class WindowPositionerTest; // WindowPositioner is used by the browser to move new popups automatically to // a usable position on the closest work area (of the active window). -class WindowPositioner { +class ASH_EXPORT WindowPositioner { public: WindowPositioner(); ~WindowPositioner(); @@ -71,4 +72,4 @@ class WindowPositioner { } // namespace ash -#endif // CHROME_BROWSER_UI_ASH_WINDOW_POSITIONER_H_ +#endif // ASH_WM_WINDOW_POSITIONER_H_ diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index ab32955..ab69026 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc @@ -27,7 +27,6 @@ #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/launcher_context_menu.h" #include "chrome/browser/ui/ash/user_action_handler.h" -#include "chrome/browser/ui/ash/window_positioner.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_finder.h" @@ -100,8 +99,7 @@ class ChromeShellDelegate::TabRestoreHelper : public TabRestoreServiceObserver { }; ChromeShellDelegate::ChromeShellDelegate() - : window_positioner_(new ash::WindowPositioner()), - weak_factory_(this), + : weak_factory_(this), launcher_delegate_(NULL) { instance_ = this; PlatformInit(); diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index d1f6bf4..e5199cb 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h @@ -17,10 +17,6 @@ class Browser; -namespace ash { -class WindowPositioner; -} - namespace content { class WebContents; } @@ -39,10 +35,6 @@ class ChromeShellDelegate : public ash::ShellDelegate, static ChromeShellDelegate* instance() { return instance_; } - ash::WindowPositioner* window_positioner() { - return window_positioner_.get(); - } - // ash::ShellDelegate overrides; virtual bool IsFirstRunAfterBoot() const OVERRIDE; virtual bool IsMultiProfilesEnabled() const OVERRIDE; @@ -117,8 +109,6 @@ class ChromeShellDelegate : public ash::ShellDelegate, content::NotificationRegistrar registrar_; - scoped_ptr<ash::WindowPositioner> window_positioner_; - base::WeakPtrFactory<ChromeShellDelegate> weak_factory_; ChromeLauncherController* launcher_delegate_; diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_views.cc b/chrome/browser/ui/ash/chrome_shell_delegate_views.cc index 7c250ab..c6cf777 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate_views.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate_views.cc @@ -12,7 +12,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/ash/caps_lock_delegate_views.h" #include "chrome/browser/ui/ash/session_state_delegate_views.h" -#include "chrome/browser/ui/ash/window_positioner.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_tabstrip.h" diff --git a/chrome/browser/ui/ash/window_positioner_unittest.cc b/chrome/browser/ui/ash/window_positioner_unittest.cc index 3842e2a..35d96bb 100644 --- a/chrome/browser/ui/ash/window_positioner_unittest.cc +++ b/chrome/browser/ui/ash/window_positioner_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/ash/window_positioner.h" +#include "ash/wm/window_positioner.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc index c783b7a..e5a1c9f 100644 --- a/chrome/browser/ui/window_sizer/window_sizer.cc +++ b/chrome/browser/ui/window_sizer/window_sizer.cc @@ -19,9 +19,9 @@ #include "ui/gfx/screen.h" #if defined(USE_ASH) +#include "ash/shell.h" +#include "ash/wm/window_positioner.h" #include "chrome/browser/ui/ash/ash_init.h" -#include "chrome/browser/ui/ash/chrome_shell_delegate.h" -#include "chrome/browser/ui/ash/window_positioner.h" #endif // Minimum height of the visible part of a window. @@ -221,7 +221,7 @@ void WindowSizer::DetermineWindowBoundsAndShowState( // looking for a good screen location. We are interpreting (0,0) as an // unspecified location. if (IsPopupBrowserInAsh() && bounds->origin().IsOrigin()) { - *bounds = ChromeShellDelegate::instance()->window_positioner()-> + *bounds = ash::Shell::GetInstance()->window_positioner()-> GetPopupPosition(*bounds); return; } diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi index 10c2375..cdfc402 100644 --- a/chrome/chrome_browser_ui.gypi +++ b/chrome/chrome_browser_ui.gypi @@ -299,8 +299,6 @@ 'browser/ui/ash/user_wallpaper_delegate_win.h', 'browser/ui/ash/volume_controller_chromeos.cc', 'browser/ui/ash/volume_controller_chromeos.h', - 'browser/ui/ash/window_positioner.cc', - 'browser/ui/ash/window_positioner.h', 'browser/ui/aura/active_desktop_monitor.cc', 'browser/ui/aura/active_desktop_monitor.h', 'browser/ui/aura/chrome_browser_main_extra_parts_aura.cc', |