diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 09:47:41 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-13 09:47:41 +0000 |
commit | dee135854291e30de3c41c6e334e4557a80144b8 (patch) | |
tree | 35b883cd5888546f634ed1fdaf0da83673262483 /ash | |
parent | d90b839ad378031602d5dbdf846c58994d451403 (diff) | |
download | chromium_src-dee135854291e30de3c41c6e334e4557a80144b8.zip chromium_src-dee135854291e30de3c41c6e334e4557a80144b8.tar.gz chromium_src-dee135854291e30de3c41c6e334e4557a80144b8.tar.bz2 |
Add flag --ash-extended-desktop Add placeholder to specify secondary display layout
TBR=derat@chromium.org
BUG=123160
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10532122
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash_switches.cc | 3 | ||||
-rw-r--r-- | ash/ash_switches.h | 1 | ||||
-rw-r--r-- | ash/monitor/monitor_controller.cc | 16 | ||||
-rw-r--r-- | ash/monitor/monitor_controller.h | 18 |
4 files changed, 37 insertions, 1 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc index e83b02c..92f7b97 100644 --- a/ash/ash_switches.cc +++ b/ash/ash_switches.cc @@ -19,6 +19,9 @@ const char kAshTouchHud[] = "ash-touch-hud"; // If present animations are disabled. const char kAshWindowAnimationsDisabled[] = "ash-window-animations-disabled"; +// Enable extended desktop. +const char kAuraExtendedDesktop[] = "ash-extended-desktop"; + // Use Google-style dialog box frames. const char kAuraGoogleDialogFrames[] = "aura-google-dialog-frames"; diff --git a/ash/ash_switches.h b/ash/ash_switches.h index 14eb279..bfb0f90 100644 --- a/ash/ash_switches.h +++ b/ash/ash_switches.h @@ -20,6 +20,7 @@ ASH_EXPORT extern const char kAshEnableOak[]; ASH_EXPORT extern const char kAshNotify[]; ASH_EXPORT extern const char kAshTouchHud[]; ASH_EXPORT extern const char kAshWindowAnimationsDisabled[]; +ASH_EXPORT extern const char kAuraExtendedDesktop[]; ASH_EXPORT extern const char kAuraGoogleDialogFrames[]; ASH_EXPORT extern const char kAuraLegacyPowerButton[]; ASH_EXPORT extern const char kAuraNoShadows[]; diff --git a/ash/monitor/monitor_controller.cc b/ash/monitor/monitor_controller.cc index f430db7..8269947 100644 --- a/ash/monitor/monitor_controller.cc +++ b/ash/monitor/monitor_controller.cc @@ -4,8 +4,10 @@ #include "ash/monitor/monitor_controller.h" +#include "ash/ash_switches.h" #include "ash/monitor/multi_monitor_manager.h" #include "ash/shell.h" +#include "base/command_line.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" @@ -14,7 +16,8 @@ namespace ash { namespace internal { -MonitorController::MonitorController() { +MonitorController::MonitorController() + : secondary_display_layout_(RIGHT) { aura::Env::GetInstance()->monitor_manager()->AddObserver(this); Init(); } @@ -39,6 +42,17 @@ void MonitorController::GetAllRootWindows( windows->push_back(it->second); } +void MonitorController::SetSecondaryDisplayLayout( + SecondaryDisplayLayout layout) { + secondary_display_layout_ = layout; +} + +bool MonitorController::IsExtendedDesktopEnabled(){ + static bool enabled = CommandLine::ForCurrentProcess()->HasSwitch( + switches::kAuraExtendedDesktop); + return enabled; +} + void MonitorController::OnDisplayBoundsChanged(const gfx::Display& display) { root_windows_[display.id()]->SetHostBounds(display.bounds_in_pixel()); } diff --git a/ash/monitor/monitor_controller.h b/ash/monitor/monitor_controller.h index 0af1b60..d61f5ab 100644 --- a/ash/monitor/monitor_controller.h +++ b/ash/monitor/monitor_controller.h @@ -29,9 +29,25 @@ class MonitorController : public aura::DisplayObserver { MonitorController(); virtual ~MonitorController(); + // Layout options where the secondary monitor should be positioned. + enum SecondaryDisplayLayout { + TOP, + RIGHT, + BOTTOM, + LEFT + }; + // Gets all of the root windows. void GetAllRootWindows(std::vector<aura::RootWindow*>* windows); + SecondaryDisplayLayout secondary_display_layout() const { + return secondary_display_layout_; + } + void SetSecondaryDisplayLayout(SecondaryDisplayLayout layout); + + // Is extended desktop enabled? + bool IsExtendedDesktopEnabled(); + // aura::DisplayObserver overrides: virtual void OnDisplayBoundsChanged( const gfx::Display& display) OVERRIDE; @@ -43,6 +59,8 @@ class MonitorController : public aura::DisplayObserver { std::map<int, aura::RootWindow*> root_windows_; + SecondaryDisplayLayout secondary_display_layout_; + DISALLOW_COPY_AND_ASSIGN(MonitorController); }; |