OLD | NEW |
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" |
11 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 11 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
12 #include "chrome/test/base/test_browser_window.h" | 12 #include "chrome/test/base/test_browser_window.h" |
13 #include "content/public/browser/browser_thread.h" | |
14 #include "content/public/test/test_browser_thread.h" | 13 #include "content/public/test/test_browser_thread.h" |
15 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
16 | 15 |
17 // Some standard primary monitor sizes (no task bar). | 16 // Some standard primary monitor sizes (no task bar). |
18 static const gfx::Rect p1024x768(0, 0, 1024, 768); | 17 static const gfx::Rect p1024x768(0, 0, 1024, 768); |
19 static const gfx::Rect p1280x1024(0, 0, 1280, 1024); | 18 static const gfx::Rect p1280x1024(0, 0, 1280, 1024); |
20 static const gfx::Rect p1600x1200(0, 0, 1600, 1200); | 19 static const gfx::Rect p1600x1200(0, 0, 1600, 1200); |
21 static const gfx::Rect p1680x1050(0, 0, 1680, 1050); | 20 static const gfx::Rect p1680x1050(0, 0, 1680, 1050); |
22 static const gfx::Rect p1920x1200(0, 0, 1920, 1200); | 21 static const gfx::Rect p1920x1200(0, 0, 1920, 1200); |
23 | 22 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 std::vector<gfx::Rect> work_areas_; | 68 std::vector<gfx::Rect> work_areas_; |
70 | 69 |
71 DISALLOW_COPY_AND_ASSIGN(TestMonitorInfoProvider); | 70 DISALLOW_COPY_AND_ASSIGN(TestMonitorInfoProvider); |
72 }; | 71 }; |
73 | 72 |
74 // Testing implementation of WindowSizer::StateProvider that we use to fake | 73 // Testing implementation of WindowSizer::StateProvider that we use to fake |
75 // persistent storage and existing windows. | 74 // persistent storage and existing windows. |
76 class TestStateProvider : public WindowSizer::StateProvider { | 75 class TestStateProvider : public WindowSizer::StateProvider { |
77 public: | 76 public: |
78 TestStateProvider(); | 77 TestStateProvider(); |
79 virtual ~TestStateProvider() {}; | 78 virtual ~TestStateProvider() {} |
80 | 79 |
81 void SetPersistentState(const gfx::Rect& bounds, | 80 void SetPersistentState(const gfx::Rect& bounds, |
82 const gfx::Rect& work_area, | 81 const gfx::Rect& work_area, |
83 ui::WindowShowState show_state, | 82 ui::WindowShowState show_state, |
84 bool has_persistent_data); | 83 bool has_persistent_data); |
85 void SetLastActiveState(const gfx::Rect& bounds, | 84 void SetLastActiveState(const gfx::Rect& bounds, |
86 ui::WindowShowState show_state, | 85 ui::WindowShowState show_state, |
87 bool has_last_active_data); | 86 bool has_last_active_data); |
88 | 87 |
89 // Overridden from WindowSizer::StateProvider: | 88 // Overridden from WindowSizer::StateProvider: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 149 |
151 // Set up the various show states and get the resulting show state from | 150 // Set up the various show states and get the resulting show state from |
152 // the WindowSizer. | 151 // the WindowSizer. |
153 ui::WindowShowState GetWindowShowState( | 152 ui::WindowShowState GetWindowShowState( |
154 ui::WindowShowState show_state_persisted, | 153 ui::WindowShowState show_state_persisted, |
155 ui::WindowShowState show_state_last, | 154 ui::WindowShowState show_state_last, |
156 Source source, | 155 Source source, |
157 const Browser* browser); | 156 const Browser* browser); |
158 | 157 |
159 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ | 158 #endif // CHROME_BROWSER_UI_WINDOW_SIZER_WINDOW_SIZER_COMMON_UNITTEST_H_ |
OLD | NEW |