summaryrefslogtreecommitdiffstats
path: root/ash/system
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-12 00:56:57 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-12 00:56:57 +0000
commit42e04c674a82fc5fb48f15ddeb2e7b9be6ce479f (patch)
treef5c2686556012576bd88333ed969a6ecd9999eb2 /ash/system
parent12f7df3b836b65b5b372d17ccffd5fb79818c56d (diff)
downloadchromium_src-42e04c674a82fc5fb48f15ddeb2e7b9be6ce479f.zip
chromium_src-42e04c674a82fc5fb48f15ddeb2e7b9be6ce479f.tar.gz
chromium_src-42e04c674a82fc5fb48f15ddeb2e7b9be6ce479f.tar.bz2
Re-implement overscan & Implement Display Rotation
- Use RootWindow's transform to implement insets - Update WorksspaceWindowResizerUnittests to use UpdateDisplay to update display properly. - Disable updating display when host window's size has changed during the test. This is causing flakyness as ConfigureNotify may arrive after the size has changed to yet another bounds. - Re-assign screen rotation to shift-ctrl-refresh. BUG=119268,174721 TEST=covered by unittests. manual. Review URL: https://codereview.chromium.org/12746002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r--ash/system/chromeos/tray_display.cc25
1 files changed, 20 insertions, 5 deletions
diff --git a/ash/system/chromeos/tray_display.cc b/ash/system/chromeos/tray_display.cc
index a7f73c1..60176ac 100644
--- a/ash/system/chromeos/tray_display.cc
+++ b/ash/system/chromeos/tray_display.cc
@@ -13,6 +13,7 @@
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_views.h"
+#include "base/chromeos/chromeos_version.h"
#include "base/utf_string_conversions.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
@@ -57,7 +58,11 @@ class DisplayView : public ash::internal::ActionableView {
virtual ~DisplayView() {}
void Update() {
- switch (Shell::GetInstance()->output_configurator()->output_state()) {
+ chromeos::OutputState state =
+ base::chromeos::IsRunningOnChromeOS() ?
+ Shell::GetInstance()->output_configurator()->output_state() :
+ InferOutputState();
+ switch (state) {
case chromeos::STATE_INVALID:
case chromeos::STATE_HEADLESS:
case chromeos::STATE_SINGLE:
@@ -81,19 +86,30 @@ class DisplayView : public ash::internal::ActionableView {
}
}
+ chromeos::OutputState InferOutputState() const {
+ return Shell::GetScreen()->GetNumDisplays() == 1 ?
+ chromeos::STATE_SINGLE : chromeos::STATE_DUAL_EXTENDED;
+ }
+
private:
// Returns the name of the currently connected external display.
- string16 GetExternalDisplayName() {
-#if defined(USE_X11)
+ string16 GetExternalDisplayName() const {
+ if (base::chromeos::IsRunningOnChromeOS())
+ return GetNativeExternalDisplayName();
+ return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME);
+ }
+
+ string16 GetNativeExternalDisplayName() const {
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
int64 internal_display_id = gfx::Display::InternalDisplayId();
int64 primary_display_id =
- gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().id();
+ Shell::GetScreen()->GetPrimaryDisplay().id();
// Use xrandr features rather than DisplayManager to find out the external
// display's name. DisplayManager's API doesn't work well in mirroring mode
// since it's based on gfx::Display but in mirroring mode there's only one
// gfx::Display instance which represents both displays.
+ // TODO(oshima): Use DisplayManager to get external display name.
std::vector<XID> outputs;
ui::GetOutputDeviceHandles(&outputs);
for (size_t i = 0; i < outputs.size(); ++i) {
@@ -118,7 +134,6 @@ class DisplayView : public ash::internal::ActionableView {
return UTF8ToUTF16(name);
}
}
-#endif
return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME);
}