| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 void DetachedPanelCollection::SortPanels(PanelsComparer comparer) { | 233 void DetachedPanelCollection::SortPanels(PanelsComparer comparer) { |
| 234 panels_.sort(comparer); | 234 panels_.sort(comparer); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { | 237 void DetachedPanelCollection::UpdatePanelOnCollectionChange(Panel* panel) { |
| 238 panel->set_attention_mode( | 238 panel->set_attention_mode( |
| 239 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | | 239 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | |
| 240 Panel::USE_SYSTEM_ATTENTION)); | 240 Panel::USE_SYSTEM_ATTENTION)); |
| 241 panel->ShowShadow(true); | 241 panel->ShowShadow(true); |
| 242 panel->EnableResizeByMouse(true); | |
| 243 panel->UpdateMinimizeRestoreButtonVisibility(); | 242 panel->UpdateMinimizeRestoreButtonVisibility(); |
| 244 panel->SetWindowCornerStyle(panel::ALL_ROUNDED); | 243 panel->SetWindowCornerStyle(panel::ALL_ROUNDED); |
| 245 } | 244 } |
| 246 | 245 |
| 247 void DetachedPanelCollection::OnPanelExpansionStateChanged(Panel* panel) { | 246 void DetachedPanelCollection::OnPanelExpansionStateChanged(Panel* panel) { |
| 248 // This should only be reached when a minimized stacked panel is dragged out | 247 // This should only be reached when a minimized stacked panel is dragged out |
| 249 // of the stack to become detached. For this case, the panel needs to be | 248 // of the stack to become detached. For this case, the panel needs to be |
| 250 // restored. | 249 // restored. |
| 251 DCHECK_EQ(Panel::EXPANDED, panel->expansion_state()); | 250 DCHECK_EQ(Panel::EXPANDED, panel->expansion_state()); |
| 252 | 251 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 283 | 282 |
| 284 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() { | 283 void DetachedPanelCollection::ComputeNextDefaultPanelOrigin() { |
| 285 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels); | 284 default_panel_origin_.Offset(kPanelTilePixels, kPanelTilePixels); |
| 286 gfx::Rect work_area = | 285 gfx::Rect work_area = |
| 287 panel_manager_->display_settings_provider()->GetPrimaryWorkArea(); | 286 panel_manager_->display_settings_provider()->GetPrimaryWorkArea(); |
| 288 if (!work_area.Contains(default_panel_origin_)) { | 287 if (!work_area.Contains(default_panel_origin_)) { |
| 289 default_panel_origin_.SetPoint(kPanelTilePixels + work_area.x(), | 288 default_panel_origin_.SetPoint(kPanelTilePixels + work_area.x(), |
| 290 kPanelTilePixels + work_area.y()); | 289 kPanelTilePixels + work_area.y()); |
| 291 } | 290 } |
| 292 } | 291 } |
| OLD | NEW |