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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 int delta_y) { | 156 int delta_y) { |
157 gfx::Rect new_bounds(panel->GetBounds()); | 157 gfx::Rect new_bounds(panel->GetBounds()); |
158 new_bounds.Offset(delta_x, delta_y); | 158 new_bounds.Offset(delta_x, delta_y); |
159 panel->SetPanelBoundsInstantly(new_bounds); | 159 panel->SetPanelBoundsInstantly(new_bounds); |
160 } | 160 } |
161 | 161 |
162 void DetachedPanelStrip::EndDraggingPanelWithinStrip(Panel* panel, | 162 void DetachedPanelStrip::EndDraggingPanelWithinStrip(Panel* panel, |
163 bool aborted) { | 163 bool aborted) { |
164 } | 164 } |
165 | 165 |
166 bool DetachedPanelStrip::CanResizePanel(const Panel* panel) const { | 166 panel::Resizability DetachedPanelStrip::GetPanelResizability( |
167 return true; | 167 const Panel* panel) const { |
| 168 return panel::RESIZABLE_ALL_SIDES; |
168 } | 169 } |
169 | 170 |
170 void DetachedPanelStrip::OnPanelResizedByMouse(Panel* panel, | 171 void DetachedPanelStrip::OnPanelResizedByMouse(Panel* panel, |
171 const gfx::Rect& new_bounds) { | 172 const gfx::Rect& new_bounds) { |
172 DCHECK_EQ(this, panel->panel_strip()); | 173 DCHECK_EQ(this, panel->panel_strip()); |
173 panel->set_restored_size(new_bounds.size()); | |
174 panel->SetPanelBoundsInstantly(new_bounds); | 174 panel->SetPanelBoundsInstantly(new_bounds); |
175 } | 175 } |
176 | 176 |
177 | 177 |
178 bool DetachedPanelStrip::HasPanel(Panel* panel) const { | 178 bool DetachedPanelStrip::HasPanel(Panel* panel) const { |
179 return panels_.find(panel) != panels_.end(); | 179 return panels_.find(panel) != panels_.end(); |
180 } | 180 } |
181 | 181 |
182 void DetachedPanelStrip::UpdatePanelOnStripChange(Panel* panel) { | 182 void DetachedPanelStrip::UpdatePanelOnStripChange(Panel* panel) { |
183 panel->set_attention_mode( | 183 panel->set_attention_mode( |
184 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | | 184 static_cast<Panel::AttentionMode>(Panel::USE_PANEL_ATTENTION | |
185 Panel::USE_SYSTEM_ATTENTION)); | 185 Panel::USE_SYSTEM_ATTENTION)); |
186 panel->SetAlwaysOnTop(false); | 186 panel->SetAlwaysOnTop(false); |
187 panel->EnableResizeByMouse(true); | 187 panel->EnableResizeByMouse(true); |
188 } | 188 } |
OLD | NEW |