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

Side by Side Diff: chrome/browser/ui/panels/test_panel_collection_squeeze_observer.cc

Issue 2263863002: Remove implementation of Panels on OSes other than ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback Created 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/panels/test_panel_collection_squeeze_observer.h"
6
7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/ui/panels/docked_panel_collection.h"
9 #include "chrome/browser/ui/panels/panel.h"
10 #include "content/public/browser/notification_source.h"
11
12 PanelCollectionSqueezeObserver::PanelCollectionSqueezeObserver(
13 DockedPanelCollection* collection, Panel* active_panel)
14 : TestPanelNotificationObserver(
15 chrome::NOTIFICATION_PANEL_COLLECTION_UPDATED,
16 content::Source<PanelCollection>(collection)),
17 panel_collection_(collection),
18 active_panel_(active_panel) {
19 }
20
21 PanelCollectionSqueezeObserver::~PanelCollectionSqueezeObserver() {}
22
23 bool PanelCollectionSqueezeObserver::IsSqueezed(Panel* panel) {
24 return panel->GetBounds().width() < panel->GetRestoredBounds().width();
25 }
26
27 bool PanelCollectionSqueezeObserver::AtExpectedState() {
28 const DockedPanelCollection::Panels& panels = panel_collection_->panels();
29 for (DockedPanelCollection::Panels::const_iterator iter = panels.begin();
30 iter != panels.end(); ++iter) {
31 if (*iter == active_panel_) {
32 if (IsSqueezed(*iter))
33 return false;
34 } else if (!IsSqueezed(*iter)) {
35 return false;
36 }
37 }
38 return true;
39 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/test_panel_collection_squeeze_observer.h ('k') | chrome/browser/ui/panels/test_panel_mouse_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698