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 #include "chrome/browser/ui/panels/overflow_panel_strip.h" | 5 #include "chrome/browser/ui/panels/overflow_panel_strip.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/ui/panels/docked_panel_strip.h" | 8 #include "chrome/browser/ui/panels/docked_panel_strip.h" |
9 #include "chrome/browser/ui/panels/panel_manager.h" | 9 #include "chrome/browser/ui/panels/panel_manager.h" |
10 #include "chrome/browser/ui/panels/native_panel.h" | |
11 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 10 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
12 #include "chrome/browser/ui/panels/panel_overflow_indicator.h" | 11 #include "chrome/browser/ui/panels/panel_overflow_indicator.h" |
13 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
14 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
15 #include "ui/base/animation/slide_animation.h" | 14 #include "ui/base/animation/slide_animation.h" |
16 | 15 |
17 namespace { | 16 namespace { |
18 // The width of the overflow area that is expanded to show more info, i.e. | 17 // The width of the overflow area that is expanded to show more info, i.e. |
19 // titles, when the mouse hovers over the area. | 18 // titles, when the mouse hovers over the area. |
20 static const int kOverflowAreaHoverWidth = 200; | 19 static const int kOverflowAreaHoverWidth = 200; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Overflow is already a minimized mode for a panel. Nothing more to do. | 174 // Overflow is already a minimized mode for a panel. Nothing more to do. |
176 } | 175 } |
177 | 176 |
178 void OverflowPanelStrip::RestorePanel(Panel* panel) { | 177 void OverflowPanelStrip::RestorePanel(Panel* panel) { |
179 DCHECK_EQ(this, panel->panel_strip()); | 178 DCHECK_EQ(this, panel->panel_strip()); |
180 PanelStrip* docked_strip = panel_manager_->docked_strip(); | 179 PanelStrip* docked_strip = panel_manager_->docked_strip(); |
181 panel->MoveToStrip(docked_strip); | 180 panel->MoveToStrip(docked_strip); |
182 docked_strip->RestorePanel(panel); | 181 docked_strip->RestorePanel(panel); |
183 } | 182 } |
184 | 183 |
185 bool OverflowPanelStrip::IsPanelMinimized(Panel* panel) const { | |
186 // All overflow panels are considered minimized. | |
187 return true; | |
188 } | |
189 | |
190 bool OverflowPanelStrip::CanShowPanelAsActive(const Panel* panel) const { | 184 bool OverflowPanelStrip::CanShowPanelAsActive(const Panel* panel) const { |
191 // All overflow panels cannot be shown as active. | 185 // All overflow panels cannot be shown as active. |
192 return false; | 186 return false; |
193 } | 187 } |
194 | 188 |
195 bool OverflowPanelStrip::CanDragPanel(const Panel* panel) const { | 189 bool OverflowPanelStrip::CanDragPanel(const Panel* panel) const { |
196 // All overflow panels are not draggable. | 190 // All overflow panels are not draggable. |
197 return false; | 191 return false; |
198 } | 192 } |
199 | 193 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // expanded overflow panels when in full screen mode so no need | 396 // expanded overflow panels when in full screen mode so no need |
403 // to detect when mouse hovers over the overflow strip. | 397 // to detect when mouse hovers over the overflow strip. |
404 if (is_full_screen) | 398 if (is_full_screen) |
405 panel_manager_->mouse_watcher()->RemoveObserver(this); | 399 panel_manager_->mouse_watcher()->RemoveObserver(this); |
406 else | 400 else |
407 panel_manager_->mouse_watcher()->AddObserver(this); | 401 panel_manager_->mouse_watcher()->AddObserver(this); |
408 | 402 |
409 for (size_t i = 0; i < panels_.size(); ++i) | 403 for (size_t i = 0; i < panels_.size(); ++i) |
410 panels_[i]->FullScreenModeChanged(is_full_screen); | 404 panels_[i]->FullScreenModeChanged(is_full_screen); |
411 } | 405 } |
OLD | NEW |