Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 } | 58 } |
| 59 | 59 |
| 60 void DetachedPanelStrip::OnPanelAttentionStateChanged(Panel* panel) { | 60 void DetachedPanelStrip::OnPanelAttentionStateChanged(Panel* panel) { |
| 61 DCHECK_EQ(this, panel->panel_strip()); | 61 DCHECK_EQ(this, panel->panel_strip()); |
| 62 // Nothing to do. | 62 // Nothing to do. |
| 63 } | 63 } |
| 64 | 64 |
| 65 void DetachedPanelStrip::OnPanelTitlebarClicked(Panel* panel, | 65 void DetachedPanelStrip::OnPanelTitlebarClicked(Panel* panel, |
| 66 panel::ClickModifier modifier) { | 66 panel::ClickModifier modifier) { |
| 67 DCHECK_EQ(this, panel->panel_strip()); | 67 DCHECK_EQ(this, panel->panel_strip()); |
| 68 // Click on detached panel titlebars does not do anything. | 68 panel->Activate(); |
|
Dmitry Titov
2012/04/18 01:49:46
See the comment in the same method of the DockStri
jennb
2012/04/24 18:47:14
Reverted.
| |
| 69 } | 69 } |
| 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(), |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 |