summaryrefslogtreecommitdiffstats
path: root/ui/gfx
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-10 15:43:53 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-10 15:43:53 +0000
commit5544450654bfa0c36809e104014dd96215d05b4d (patch)
treecdf089e5aff5c4f5329648ddf06751fd3adc6f74 /ui/gfx
parentb0055b9c2fb9713631930dfa95d1112b0c7ec590 (diff)
downloadchromium_src-5544450654bfa0c36809e104014dd96215d05b4d.zip
chromium_src-5544450654bfa0c36809e104014dd96215d05b4d.tar.gz
chromium_src-5544450654bfa0c36809e104014dd96215d05b4d.tar.bz2
Adds the option of aligning the launcher to the left or right. There
is a ton of rough edges after this patch, but I don't want this patch to get any bigger. BUG=121962 TEST=covered by tests. R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/10388036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r--ui/gfx/monitor.cc7
-rw-r--r--ui/gfx/monitor.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/ui/gfx/monitor.cc b/ui/gfx/monitor.cc
index 36dde84..12d4dab 100644
--- a/ui/gfx/monitor.cc
+++ b/ui/gfx/monitor.cc
@@ -58,6 +58,13 @@ Monitor::Monitor(int id, const gfx::Rect& bounds)
Monitor::~Monitor() {
}
+Insets Monitor::GetWorkAreaInsets() const {
+ return gfx::Insets(work_area_.y() - bounds_.y(),
+ work_area_.x() - bounds_.x(),
+ bounds_.bottom() - work_area_.bottom(),
+ bounds_.right() - work_area_.right());
+}
+
void Monitor::SetScaleAndBounds(
float device_scale_factor,
const gfx::Rect& bounds_in_pixel) {
diff --git a/ui/gfx/monitor.h b/ui/gfx/monitor.h
index 03d757f..7428771 100644
--- a/ui/gfx/monitor.h
+++ b/ui/gfx/monitor.h
@@ -54,6 +54,9 @@ class UI_EXPORT Monitor {
const Size& size() const { return bounds_.size(); }
const Size& work_area_size() const { return work_area_.size(); }
+ // Returns the work area insets.
+ Insets GetWorkAreaInsets() const;
+
// Sets the device scale factor and monitor bounds in pixel. This
// updates the work are using the same insets between old bounds and
// work area.