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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_common_unittest.h

Issue 22888006: Use gfx::Screen to provide display information in WindowSizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 4 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 CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ 5 #ifndef CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_
6 #define CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ 6 #define CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 30 matching lines...) Expand all
41 static const gfx::Rect bottom_s1600x1200(0, 1200, 1600, 1200); 41 static const gfx::Rect bottom_s1600x1200(0, 1200, 1600, 1200);
42 42
43 // The work area for 1024x768 monitors with different taskbar orientations. 43 // The work area for 1024x768 monitors with different taskbar orientations.
44 static const gfx::Rect taskbar_bottom_work_area(0, 0, 1024, 734); 44 static const gfx::Rect taskbar_bottom_work_area(0, 0, 1024, 734);
45 static const gfx::Rect taskbar_top_work_area(0, 34, 1024, 734); 45 static const gfx::Rect taskbar_top_work_area(0, 34, 1024, 734);
46 static const gfx::Rect taskbar_left_work_area(107, 0, 917, 768); 46 static const gfx::Rect taskbar_left_work_area(107, 0, 917, 768);
47 static const gfx::Rect taskbar_right_work_area(0, 0, 917, 768); 47 static const gfx::Rect taskbar_right_work_area(0, 0, 917, 768);
48 48
49 extern int kWindowTilePixels; 49 extern int kWindowTilePixels;
50 50
51 // Testing implementation of WindowSizer::MonitorInfoProvider that we can use
52 // to fake various monitor layouts and sizes.
53 class TestMonitorInfoProvider : public MonitorInfoProvider {
54 public:
55 TestMonitorInfoProvider();
56 virtual ~TestMonitorInfoProvider();
57
58 void AddMonitor(const gfx::Rect& bounds, const gfx::Rect& work_area);
59
60 // Overridden from WindowSizer::MonitorInfoProvider:
61 virtual gfx::Rect GetPrimaryDisplayWorkArea() const OVERRIDE;
62
63 virtual gfx::Rect GetPrimaryDisplayBounds() const OVERRIDE;
64
65 virtual gfx::Rect GetMonitorWorkAreaMatching(
66 const gfx::Rect& match_rect) const OVERRIDE;
67
68 private:
69 size_t GetMonitorIndexMatchingBounds(const gfx::Rect& match_rect) const;
70
71 std::vector<gfx::Rect> monitor_bounds_;
72 std::vector<gfx::Rect> work_areas_;
73
74 DISALLOW_COPY_AND_ASSIGN(TestMonitorInfoProvider);
75 };
76
77 // Testing implementation of WindowSizer::StateProvider that we use to fake 51 // Testing implementation of WindowSizer::StateProvider that we use to fake
78 // persistent storage and existing windows. 52 // persistent storage and existing windows.
79 class TestStateProvider : public WindowSizer::StateProvider { 53 class TestStateProvider : public WindowSizer::StateProvider {
80 public: 54 public:
81 TestStateProvider(); 55 TestStateProvider();
82 virtual ~TestStateProvider() {} 56 virtual ~TestStateProvider() {}
83 57
84 void SetPersistentState(const gfx::Rect& bounds, 58 void SetPersistentState(const gfx::Rect& bounds,
85 const gfx::Rect& work_area, 59 const gfx::Rect& work_area,
86 ui::WindowShowState show_state, 60 ui::WindowShowState show_state,
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // the WindowSizer. 129 // the WindowSizer.
156 // The |display_config| is the primary display configuration used. 130 // The |display_config| is the primary display configuration used.
157 ui::WindowShowState GetWindowShowState( 131 ui::WindowShowState GetWindowShowState(
158 ui::WindowShowState show_state_persisted, 132 ui::WindowShowState show_state_persisted,
159 ui::WindowShowState show_state_last, 133 ui::WindowShowState show_state_last,
160 Source source, 134 Source source,
161 const Browser* browser, 135 const Browser* browser,
162 const gfx::Rect& display_config); 136 const gfx::Rect& display_config);
163 137
164 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ 138 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/window_sizer/window_sizer_ash.cc ('k') | chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698