summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 05:42:37 +0000
committeroshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 05:42:37 +0000
commita91f51922bdcce4016976f79cd6d96651d26796c (patch)
tree72e6957c2fa08e8ceb48cdcf491dd612f92c1216 /ui
parent080f34ff022299737619be0a6877b7b9b7910c54 (diff)
downloadchromium_src-a91f51922bdcce4016976f79cd6d96651d26796c.zip
chromium_src-a91f51922bdcce4016976f79cd6d96651d26796c.tar.gz
chromium_src-a91f51922bdcce4016976f79cd6d96651d26796c.tar.bz2
Initialize message pump not to use gtk.
This is a temp fix to remove gtk_init. We should remove this once we remove gtk from message pump, which should be done as a part of AURA->TOOLKIT_USES_GTK=0 WindowSizer/gfx::screen for aura BUG=none TEST=none Review URL: http://codereview.chromium.org/7943006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/desktop.cc12
-rw-r--r--ui/aura/desktop.h3
-rw-r--r--ui/gfx/screen_aura.cc16
3 files changed, 23 insertions, 8 deletions
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index aadcdef..cbf9d19 100644
--- a/ui/aura/desktop.cc
+++ b/ui/aura/desktop.cc
@@ -34,6 +34,15 @@ Desktop::~Desktop() {
instance_ = NULL;
}
+void Desktop::Init() {
+ window_->Init();
+ compositor()->set_root_layer(window_->layer());
+#if defined(USE_X11)
+ // TODO(oshima): Implement configure notify and remove this.
+ OnHostResized(host_->GetSize());
+#endif
+}
+
void Desktop::Show() {
host_->Show();
}
@@ -76,8 +85,7 @@ void Desktop::ScheduleCompositorPaint() {
Desktop* Desktop::GetInstance() {
if (!instance_) {
instance_ = new Desktop;
- instance_->window_->Init();
- instance_->compositor()->set_root_layer(instance_->window_->layer());
+ instance_->Init();
}
return instance_;
}
diff --git a/ui/aura/desktop.h b/ui/aura/desktop.h
index 089ed4e..aea93e1 100644
--- a/ui/aura/desktop.h
+++ b/ui/aura/desktop.h
@@ -29,6 +29,9 @@ class AURA_EXPORT Desktop : public ui::CompositorDelegate {
Desktop();
~Desktop();
+ // Initializes the desktop.
+ void Init();
+
// Shows the desktop host.
void Show();
diff --git a/ui/gfx/screen_aura.cc b/ui/gfx/screen_aura.cc
index 2ed1800..b3eb406 100644
--- a/ui/gfx/screen_aura.cc
+++ b/ui/gfx/screen_aura.cc
@@ -9,6 +9,8 @@
#endif
#include "base/logging.h"
+#include "ui/aura/desktop.h"
+#include "ui/aura/window.h"
#include "ui/gfx/native_widget_types.h"
namespace gfx {
@@ -26,20 +28,22 @@ gfx::Point Screen::GetCursorScreenPoint() {
// static
gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeWindow window) {
- NOTIMPLEMENTED();
- return gfx::Rect();
+ // TODO(oshima): Take window into account. Support multiple monitors.
+ aura::Window* desktop_window = aura::Desktop::GetInstance()->window();
+ return desktop_window->bounds();
}
// static
gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeWindow window) {
- NOTIMPLEMENTED();
- return gfx::Rect();
+ // TODO(oshima): Fix this for aura desktop.
+ return GetMonitorAreaNearestWindow(window);
}
static gfx::Rect GetMonitorAreaOrWorkAreaNearestPoint(const gfx::Point& point,
bool work_area) {
- NOTIMPLEMENTED();
- return gfx::Rect();
+ // TODO(oshima): Take point/work_area into account. Support multiple monitors.
+ aura::Window* desktop_window = aura::Desktop::GetInstance()->window();
+ return desktop_window->bounds();
}
// static