Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3332)

Unified Diff: chrome/browser/ui/window_sizer_aura.cc

Issue 7943006: Initialize message pump not to use gtk. WindowSizer for aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing file Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/window_sizer_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/window_sizer_aura.cc
diff --git a/chrome/browser/ui/window_sizer_aura.cc b/chrome/browser/ui/window_sizer_aura.cc
new file mode 100644
index 0000000000000000000000000000000000000000..07354c33d42736212b88d0802a6225ce3625e0c3
--- /dev/null
+++ b/chrome/browser/ui/window_sizer_aura.cc
@@ -0,0 +1,64 @@
+// Copyright (c) 2009 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/window_sizer.h"
+
+#include "ui/aura/desktop.h"
+#include "ui/aura/window.h"
+#include "ui/gfx/screen.h"
+
+// TODO(oshima): Get This from WindowManager
+const int WindowSizer::kWindowTilePixels = 10;
+
+// An implementation of WindowSizer::MonitorInfoProvider that gets the actual
+// monitor information from X via GDK.
+class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
+ public:
+ DefaultMonitorInfoProvider() { }
+
+ virtual gfx::Rect GetPrimaryMonitorWorkArea() const {
+ return gfx::Screen::GetMonitorWorkAreaNearestPoint(
+ gfx::Point(0, 0));
+ }
+
+ virtual gfx::Rect GetPrimaryMonitorBounds() const {
+ aura::Window* desktop_window = aura::Desktop::GetInstance()->window();
+ return desktop_window->bounds();
+ }
+
+ virtual gfx::Rect GetMonitorWorkAreaMatching(
+ const gfx::Rect& match_rect) const {
+ return gfx::Screen::GetMonitorWorkAreaNearestPoint(
+ match_rect.origin());
+ }
+
+ virtual gfx::Point GetBoundsOffsetMatching(
+ const gfx::Rect& match_rect) const {
+ return GetMonitorWorkAreaMatching(match_rect).origin();
+ }
+
+ void UpdateWorkAreas() {
+ work_areas_.clear();
+ work_areas_.push_back(GetPrimaryMonitorBounds());
+ }
+
+ private:
+
+ DISALLOW_COPY_AND_ASSIGN(DefaultMonitorInfoProvider);
+};
+
+// static
+WindowSizer::MonitorInfoProvider*
+WindowSizer::CreateDefaultMonitorInfoProvider() {
+ return new DefaultMonitorInfoProvider();
+}
+
+// static
+gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size) {
+ // TODO(oshima):This is used to control panel/popups, and this may
+ // not be needed on aura environment as they must be controlled by
+ // WM.
+ NOTIMPLEMENTED();
+ return gfx::Point();
+}
« no previous file with comments | « no previous file | chrome/browser/ui/window_sizer_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698