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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/window_sizer_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/window_sizer.h"
6
7 #include "ui/aura/desktop.h"
8 #include "ui/aura/window.h"
9 #include "ui/gfx/screen.h"
10
11 // TODO(oshima): Get This from WindowManager
12 const int WindowSizer::kWindowTilePixels = 10;
13
14 // An implementation of WindowSizer::MonitorInfoProvider that gets the actual
15 // monitor information from X via GDK.
16 class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
17 public:
18 DefaultMonitorInfoProvider() { }
19
20 virtual gfx::Rect GetPrimaryMonitorWorkArea() const {
21 return gfx::Screen::GetMonitorWorkAreaNearestPoint(
22 gfx::Point(0, 0));
23 }
24
25 virtual gfx::Rect GetPrimaryMonitorBounds() const {
26 aura::Window* desktop_window = aura::Desktop::GetInstance()->window();
27 return desktop_window->bounds();
28 }
29
30 virtual gfx::Rect GetMonitorWorkAreaMatching(
31 const gfx::Rect& match_rect) const {
32 return gfx::Screen::GetMonitorWorkAreaNearestPoint(
33 match_rect.origin());
34 }
35
36 virtual gfx::Point GetBoundsOffsetMatching(
37 const gfx::Rect& match_rect) const {
38 return GetMonitorWorkAreaMatching(match_rect).origin();
39 }
40
41 void UpdateWorkAreas() {
42 work_areas_.clear();
43 work_areas_.push_back(GetPrimaryMonitorBounds());
44 }
45
46 private:
47
48 DISALLOW_COPY_AND_ASSIGN(DefaultMonitorInfoProvider);
49 };
50
51 // static
52 WindowSizer::MonitorInfoProvider*
53 WindowSizer::CreateDefaultMonitorInfoProvider() {
54 return new DefaultMonitorInfoProvider();
55 }
56
57 // static
58 gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size) {
59 // TODO(oshima):This is used to control panel/popups, and this may
60 // not be needed on aura environment as they must be controlled by
61 // WM.
62 NOTIMPLEMENTED();
63 return gfx::Point();
64 }
OLDNEW
« 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