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

Side by Side Diff: chrome/browser/ui/monitor_info_provider.h

Issue 8549008: Extract MonitorInfoProvider from WindowSizer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 2 Created 9 years 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
(Empty)
1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_MONITOR_INFO_PROVIDER_H_
6 #define CHROME_BROWSER_UI_MONITOR_INFO_PROVIDER_H_
7 #pragma once
8
9 #include <stddef.h>
10
11 #include <vector>
12
13 #include "base/basictypes.h"
14 #include "ui/gfx/rect.h"
15
16 // An interface implemented by an object that can retrieve information about
17 // the monitors on the system.
18 class MonitorInfoProvider {
Ben Goodger (Google) 2011/12/02 17:10:32 So, I actually think we can get rid of this class
tfarina 2011/12/02 17:24:43 This is crbug.com/101507
19 public:
20 // Creates an appropriate MonitorInfoProvider for the platform.
21 // The returned object is owned by the caller.
22 static MonitorInfoProvider* Create();
23
24 MonitorInfoProvider();
25 virtual ~MonitorInfoProvider();
26
27 // Returns the bounds of the work area of the primary monitor.
28 virtual gfx::Rect GetPrimaryMonitorWorkArea() const = 0;
29
30 // Returns the bounds of the primary monitor.
31 virtual gfx::Rect GetPrimaryMonitorBounds() const = 0;
32
33 // Returns the bounds of the work area of the monitor that most closely
34 // intersects the provided bounds.
35 virtual gfx::Rect GetMonitorWorkAreaMatching(
36 const gfx::Rect& match_rect) const = 0;
37
38 // Ensures number and coordinates of work areas are up-to-date. You must
39 // call this before calling either of the below functions, as work areas can
40 // change while the program is running.
41 virtual void UpdateWorkAreas() = 0;
Ben Goodger (Google) 2011/12/02 17:10:32 As far as I can tell, this function is never calle
tfarina 2011/12/02 17:24:43 Removed.
42
43 // Returns the number of monitors on the system.
44 size_t GetMonitorCount() const { return work_areas_.size(); }
Ben Goodger (Google) 2011/12/02 17:10:32 This function is only called from a function in Wi
tfarina 2011/12/02 17:24:43 Removed.
45
46 // Returns the bounds of the work area of the monitor at the specified
47 // index.
48 gfx::Rect GetWorkAreaAt(size_t index) const {
Ben Goodger (Google) 2011/12/02 17:10:32 This function is only called from a function in Wi
tfarina 2011/12/02 17:24:43 Removed.
49 return work_areas_[index];
50 }
51
52 protected:
53 std::vector<gfx::Rect> work_areas_;
54
55 private:
56 DISALLOW_COPY_AND_ASSIGN(MonitorInfoProvider);
57 };
58
59 #endif // CHROME_BROWSER_UI_MONITOR_INFO_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698