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_PANELS_TEST_PANEL_COLLECTION_SQUEEZE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_TEST_PANEL_COLLECTION_SQUEEZE_OBSERVER_H_ |
6 #define CHROME_BROWSER_UI_PANELS_TEST_PANEL_COLLECTION_SQUEEZE_OBSERVER_H_ | 6 #define CHROME_BROWSER_UI_PANELS_TEST_PANEL_COLLECTION_SQUEEZE_OBSERVER_H_ |
7 | 7 |
8 #include "chrome/browser/ui/panels/test_panel_notification_observer.h" | 8 #include "chrome/browser/ui/panels/test_panel_notification_observer.h" |
9 | 9 |
10 class DockedPanelCollection; | 10 class DockedPanelCollection; |
11 class Panel; | 11 class Panel; |
12 | 12 |
13 // Custom notification observer for waiting on panel collection that squeezes | 13 // Custom notification observer for waiting on panel collection that squeezes |
14 // its panels to reflect a certain state. | 14 // its panels to reflect a certain state. |
15 // Modeled after ui_test_utils notification observers. | 15 // Modeled after ui_test_utils notification observers. |
16 class PanelCollectionSqueezeObserver : public TestPanelNotificationObserver { | 16 class PanelCollectionSqueezeObserver : public TestPanelNotificationObserver { |
17 public: | 17 public: |
18 // Register to listen for panel collection updated notifications | 18 // Register to listen for panel collection updated notifications |
19 // from the specified collection to detect a change to the state | 19 // from the specified collection to detect a change to the state |
20 // where the |active_panel| is at full width and all other | 20 // where the |active_panel| is at full width and all other |
21 // panels in the collection are squeezed. | 21 // panels in the collection are squeezed. |
22 PanelCollectionSqueezeObserver(DockedPanelCollection* collection, | 22 PanelCollectionSqueezeObserver(DockedPanelCollection* collection, |
23 Panel* active_panel); | 23 Panel* active_panel); |
24 virtual ~PanelCollectionSqueezeObserver(); | 24 ~PanelCollectionSqueezeObserver() override; |
25 | 25 |
26 private: | 26 private: |
27 // TestNotificationObserver override: | 27 // TestNotificationObserver override: |
28 virtual bool AtExpectedState() override; | 28 bool AtExpectedState() override; |
29 | 29 |
30 bool IsSqueezed(Panel* panel); | 30 bool IsSqueezed(Panel* panel); |
31 | 31 |
32 DockedPanelCollection* panel_collection_; | 32 DockedPanelCollection* panel_collection_; |
33 Panel* active_panel_; | 33 Panel* active_panel_; |
34 | 34 |
35 DISALLOW_COPY_AND_ASSIGN(PanelCollectionSqueezeObserver); | 35 DISALLOW_COPY_AND_ASSIGN(PanelCollectionSqueezeObserver); |
36 }; | 36 }; |
37 | 37 |
38 #endif // CHROME_BROWSER_UI_PANELS_TEST_PANEL_COLLECTION_SQUEEZE_OBSERVER_H_ | 38 #endif // CHROME_BROWSER_UI_PANELS_TEST_PANEL_COLLECTION_SQUEEZE_OBSERVER_H_ |
OLD | NEW |