| 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_strip.h" | 5 #include "chrome/browser/ui/panels/detached_panel_strip.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/panel_drag_controller.h" | 9 #include "chrome/browser/ui/panels/panel_drag_controller.h" |
| 10 #include "chrome/browser/ui/panels/panel_manager.h" | 10 #include "chrome/browser/ui/panels/panel_manager.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 void DetachedPanelStrip::RefreshLayout() { | 32 void DetachedPanelStrip::RefreshLayout() { |
| 33 // Nothing needds to be done here: detached panels always stay | 33 // Nothing needds to be done here: detached panels always stay |
| 34 // where the user dragged them. | 34 // where the user dragged them. |
| 35 } | 35 } |
| 36 | 36 |
| 37 void DetachedPanelStrip::AddPanel(Panel* panel, | 37 void DetachedPanelStrip::AddPanel(Panel* panel, |
| 38 PositioningMask positioning_mask) { | 38 PositioningMask positioning_mask) { |
| 39 // positioning_mask is ignored since the detached panel is free-floating. | 39 // positioning_mask is ignored since the detached panel is free-floating. |
| 40 DCHECK_NE(this, panel->panel_strip()); | 40 DCHECK_NE(this, panel->panel_strip()); |
| 41 panel->SetPanelStrip(this); | 41 panel->set_panel_strip(this); |
| 42 panels_.insert(panel); | 42 panels_.insert(panel); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void DetachedPanelStrip::RemovePanel(Panel* panel) { | 45 void DetachedPanelStrip::RemovePanel(Panel* panel) { |
| 46 DCHECK_EQ(this, panel->panel_strip()); | 46 DCHECK_EQ(this, panel->panel_strip()); |
| 47 panel->SetPanelStrip(NULL); | 47 panel->set_panel_strip(NULL); |
| 48 panels_.erase(panel); | 48 panels_.erase(panel); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void DetachedPanelStrip::CloseAll() { | 51 void DetachedPanelStrip::CloseAll() { |
| 52 // Make a copy as closing panels can modify the iterator. | 52 // Make a copy as closing panels can modify the iterator. |
| 53 Panels panels_copy = panels_; | 53 Panels panels_copy = panels_; |
| 54 | 54 |
| 55 for (Panels::const_iterator iter = panels_copy.begin(); | 55 for (Panels::const_iterator iter = panels_copy.begin(); |
| 56 iter != panels_copy.end(); ++iter) | 56 iter != panels_copy.end(); ++iter) |
| 57 (*iter)->Close(); | 57 (*iter)->Close(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool DetachedPanelStrip::HasPanel(Panel* panel) const { | 189 bool DetachedPanelStrip::HasPanel(Panel* panel) const { |
| 190 return panels_.find(panel) != panels_.end(); | 190 return panels_.find(panel) != panels_.end(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void DetachedPanelStrip::UpdatePanelOnStripChange(Panel* panel) { | 193 void DetachedPanelStrip::UpdatePanelOnStripChange(Panel* panel) { |
| 194 panel->set_attention_mode( | 194 panel->set_attention_mode( |
| 195 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | | 195 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | |
| 196 Panel::USE_SYSTEM_ATTENTION)); | 196 Panel::USE_SYSTEM_ATTENTION)); |
| 197 panel->SetAlwaysOnTop(false); | 197 panel->SetAlwaysOnTop(false); |
| 198 panel->EnableResizeByMouse(true); | 198 panel->EnableResizeByMouse(true); |
| 199 panel->UpdateMinimizeRestoreButtonVisibility(); |
| 199 } | 200 } |
| 200 | 201 |
| 201 void DetachedPanelStrip::OnPanelActiveStateChanged(Panel* panel) { | 202 void DetachedPanelStrip::OnPanelActiveStateChanged(Panel* panel) { |
| 202 } | 203 } |
| 203 | 204 |
| OLD | NEW |