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

Side by Side Diff: ash/screen_ash.h

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_SCREEN_ASH_H_ 5 #ifndef ASH_SCREEN_ASH_H_
6 #define ASH_SCREEN_ASH_H_ 6 #define ASH_SCREEN_ASH_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ui/gfx/insets.h" 11 #include "ui/gfx/insets.h"
12 #include "ui/gfx/screen.h" 12 #include "ui/gfx/point.h"
13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/screen_impl.h"
13 15
14 namespace aura { 16 namespace aura {
15 class RootWindow; 17 class RootWindow;
16 } 18 }
17 19
18 namespace ash { 20 namespace ash {
19 21
20 // Aura implementation of gfx::Screen. Implemented here to avoid circular 22 // Aura implementation of gfx::Screen. Implemented here to avoid circular
21 // dependencies. 23 // dependencies.
22 class ASH_EXPORT ScreenAsh : public gfx::Screen { 24 class ASH_EXPORT ScreenAsh : public gfx::ScreenImpl {
23 public: 25 public:
24 explicit ScreenAsh(aura::RootWindow* root_window); 26 explicit ScreenAsh(aura::RootWindow* root_window);
25 virtual ~ScreenAsh(); 27 virtual ~ScreenAsh();
26 28
27 // Returns the bounds for maximized windows. Maximized windows trigger 29 // Returns the bounds for maximized windows. Maximized windows trigger
28 // auto-hiding the shelf. 30 // auto-hiding the shelf.
29 static gfx::Rect GetMaximizedWindowBounds(aura::Window* window); 31 static gfx::Rect GetMaximizedWindowBounds(aura::Window* window);
30 32
31 // Returns work area when a maximized window is not present. 33 // Returns work area when a maximized window is not present.
32 static gfx::Rect GetUnmaximizedWorkAreaBounds(aura::Window* window); 34 static gfx::Rect GetUnmaximizedWorkAreaBounds(aura::Window* window);
33 35
34 protected: 36 protected:
35 virtual gfx::Point GetCursorScreenPointImpl() OVERRIDE; 37 virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
36 virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl( 38 virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE;
39
40 virtual int GetNumMonitors() OVERRIDE;
41 virtual const gfx::Monitor* GetMonitorNearestWindow(
37 gfx::NativeView view) OVERRIDE; 42 gfx::NativeView view) OVERRIDE;
38 virtual gfx::Rect GetMonitorAreaNearestWindowImpl( 43 virtual const gfx::Monitor* GetMonitorNearestPoint(
39 gfx::NativeView view) OVERRIDE;
40 virtual gfx::Rect GetMonitorWorkAreaNearestPointImpl(
41 const gfx::Point& point) OVERRIDE; 44 const gfx::Point& point) OVERRIDE;
42 virtual gfx::Rect GetMonitorAreaNearestPointImpl( 45 virtual const gfx::Monitor* GetPrimaryMonitor() OVERRIDE;
43 const gfx::Point& point) OVERRIDE; 46
44 virtual gfx::NativeWindow GetWindowAtCursorScreenPointImpl() OVERRIDE; 47 virtual void AddMonitorObserver(gfx::MonitorObserver* observer) OVERRIDE;
45 virtual gfx::Size GetPrimaryMonitorSizeImpl() OVERRIDE; 48 virtual void RemoveMonitorObserver(gfx::MonitorObserver* observer) OVERRIDE;
46 virtual int GetNumMonitorsImpl() OVERRIDE;
47 49
48 private: 50 private:
49 aura::RootWindow* root_window_; 51 aura::RootWindow* root_window_;
50 52
51 DISALLOW_COPY_AND_ASSIGN(ScreenAsh); 53 DISALLOW_COPY_AND_ASSIGN(ScreenAsh);
52 }; 54 };
53 55
54 } // namespace ash 56 } // namespace ash
55 57
56 #endif // ASH_SCREEN_ASH_H_ 58 #endif // ASH_SCREEN_ASH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698