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/detached_panel_collection.h" | 5 #include "chrome/browser/ui/panels/detached_panel_collection.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/ui/panels/display_settings_provider.h" | 9 #include "chrome/browser/ui/panels/display_settings_provider.h" |
10 #include "chrome/browser/ui/panels/panel_drag_controller.h" | 10 #include "chrome/browser/ui/panels/panel_drag_controller.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 void DetachedPanelCollection::SortPanels(PanelsComparer comparer) { | 222 void DetachedPanelCollection::SortPanels(PanelsComparer comparer) { |
223 panels_.sort(comparer); | 223 panels_.sort(comparer); |
224 } | 224 } |
225 | 225 |
226 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { | 226 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { |
227 panel->set_attention_mode( | 227 panel->set_attention_mode( |
228 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | | 228 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | |
229 Panel::USE_SYSTEM_ATTENTION)); | 229 Panel::USE_SYSTEM_ATTENTION)); |
230 panel->SetAlwaysOnTop(false); | 230 panel->SetAlwaysOnTop(false); |
| 231 panel->ShowShadow(true); |
231 panel->EnableResizeByMouse(true); | 232 panel->EnableResizeByMouse(true); |
232 panel->UpdateMinimizeRestoreButtonVisibility(); | 233 panel->UpdateMinimizeRestoreButtonVisibility(); |
233 panel->SetWindowCornerStyle(panel::ALL_ROUNDED); | 234 panel->SetWindowCornerStyle(panel::ALL_ROUNDED); |
234 } | 235 } |
235 | 236 |
236 void DetachedPanelCollection::OnPanelExpansionStateChanged(Panel* panel) { | 237 void DetachedPanelCollection::OnPanelExpansionStateChanged(Panel* panel) { |
237 // This should only be reached when a minimized stacked panel is dragged out | 238 // This should only be reached when a minimized stacked panel is dragged out |
238 // of the stack to become detached. For this case, the panel needs to be | 239 // of the stack to become detached. For this case, the panel needs to be |
239 // restored. | 240 // restored. |
240 DCHECK_EQ(Panel::EXPANDED, panel->expansion_state()); | 241 DCHECK_EQ(Panel::EXPANDED, panel->expansion_state()); |
(...skipping 18 matching lines...) Expand all Loading... |
259 | 260 |
260 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() { | 261 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() { |
261 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels); | 262 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels); |
262 gfx::Rect work_area = | 263 gfx::Rect work_area = |
263 panel_manager_->display_settings_provider()->GetPrimaryWorkArea(); | 264 panel_manager_->display_settings_provider()->GetPrimaryWorkArea(); |
264 if (!work_area.Contains(default_panel_origin_)) { | 265 if (!work_area.Contains(default_panel_origin_)) { |
265 default_panel_origin_.SetPoint(kPanelTilePixels + work_area.x(), | 266 default_panel_origin_.SetPoint(kPanelTilePixels + work_area.x(), |
266 kPanelTilePixels + work_area.y()); | 267 kPanelTilePixels + work_area.y()); |
267 } | 268 } |
268 } | 269 } |
OLD | NEW |