| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void DetachedPanelStrip::ResizePanelWindow( | 71 void DetachedPanelStrip::ResizePanelWindow( |
| 72 Panel* panel, | 72 Panel* panel, |
| 73 const gfx::Size& preferred_window_size) { | 73 const gfx::Size& preferred_window_size) { |
| 74 // We should get this call only of we have the panel. | 74 // We should get this call only of we have the panel. |
| 75 DCHECK_EQ(this, panel->panel_strip()); | 75 DCHECK_EQ(this, panel->panel_strip()); |
| 76 | 76 |
| 77 // Make sure the new size does not violate panel's size restrictions. | 77 // Make sure the new size does not violate panel's size restrictions. |
| 78 gfx::Size new_size(preferred_window_size.width(), | 78 gfx::Size new_size(preferred_window_size.width(), |
| 79 preferred_window_size.height()); | 79 preferred_window_size.height()); |
| 80 panel->ClampSize(&new_size); | 80 new_size = panel->ClampSize(new_size); |
| 81 | 81 |
| 82 // Update restored size. | 82 // Update restored size. |
| 83 if (new_size != panel->full_size()) | 83 if (new_size != panel->full_size()) |
| 84 panel->set_full_size(new_size); | 84 panel->set_full_size(new_size); |
| 85 | 85 |
| 86 gfx::Rect bounds = panel->GetBounds(); | 86 gfx::Rect bounds = panel->GetBounds(); |
| 87 | 87 |
| 88 // When we resize a detached panel, its origin does not move. | 88 // When we resize a detached panel, its origin does not move. |
| 89 // So we set height and width only. | 89 // So we set height and width only. |
| 90 bounds.set_size(new_size); | 90 bounds.set_size(new_size); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } | 199 } |
| 200 | 200 |
| 201 void DetachedPanelStrip::OnPanelActiveStateChanged(Panel* panel) { | 201 void DetachedPanelStrip::OnPanelActiveStateChanged(Panel* panel) { |
| 202 } | 202 } |
| 203 | 203 |
| OLD | NEW |