OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/panel_manager.h" | 5 #include "chrome/browser/ui/panels/panel_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } else { | 264 } else { |
265 panels_[dragging_panel_index_]->SetPanelBounds( | 265 panels_[dragging_panel_index_]->SetPanelBounds( |
266 dragging_panel_bounds_); | 266 dragging_panel_bounds_); |
267 } | 267 } |
268 | 268 |
269 dragging_panel_index_ = kInvalidPanelIndex; | 269 dragging_panel_index_ = kInvalidPanelIndex; |
270 | 270 |
271 DelayedRemove(); | 271 DelayedRemove(); |
272 } | 272 } |
273 | 273 |
274 bool PanelManager::ShouldBringUpTitleBarForAllMinimizedPanels( | 274 bool PanelManager::ShouldBringUpTitlebarForAllMinimizedPanels( |
275 int mouse_x, int mouse_y) const { | 275 int mouse_x, int mouse_y) const { |
276 for (Panels::const_iterator iter = panels_.begin(); | 276 for (Panels::const_iterator iter = panels_.begin(); |
277 iter != panels_.end(); ++iter) { | 277 iter != panels_.end(); ++iter) { |
278 if ((*iter)->ShouldBringUpTitleBar(mouse_x, mouse_y)) | 278 if ((*iter)->ShouldBringUpTitlebar(mouse_x, mouse_y)) |
279 return true; | 279 return true; |
280 } | 280 } |
281 return false; | 281 return false; |
282 } | 282 } |
283 | 283 |
284 void PanelManager::BringUpOrDownTitleBarForAllMinimizedPanels(bool bring_up) { | 284 void PanelManager::BringUpOrDownTitlebarForAllMinimizedPanels(bool bring_up) { |
285 for (Panels::const_iterator iter = panels_.begin(); | 285 for (Panels::const_iterator iter = panels_.begin(); |
286 iter != panels_.end(); ++iter) { | 286 iter != panels_.end(); ++iter) { |
287 Panel* panel = *iter; | 287 Panel* panel = *iter; |
288 | 288 |
289 // Skip any panel that is drawing the attention. | 289 // Skip any panel that is drawing the attention. |
290 if (panel->IsDrawingAttention()) | 290 if (panel->IsDrawingAttention()) |
291 continue; | 291 continue; |
292 | 292 |
293 if (bring_up) { | 293 if (bring_up) { |
294 if (panel->expansion_state() == Panel::MINIMIZED) | 294 if (panel->expansion_state() == Panel::MINIMIZED) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 void PanelManager::RemoveAll() { | 350 void PanelManager::RemoveAll() { |
351 // This should not be called when we're in the process of dragging. | 351 // This should not be called when we're in the process of dragging. |
352 DCHECK(dragging_panel_index_ == kInvalidPanelIndex); | 352 DCHECK(dragging_panel_index_ == kInvalidPanelIndex); |
353 | 353 |
354 // Start from the bottom to avoid reshuffling. | 354 // Start from the bottom to avoid reshuffling. |
355 for (Panels::reverse_iterator iter = panels_.rbegin(); | 355 for (Panels::reverse_iterator iter = panels_.rbegin(); |
356 iter != panels_.rend(); ++iter) | 356 iter != panels_.rend(); ++iter) |
357 (*iter)->Close(); | 357 (*iter)->Close(); |
358 } | 358 } |
OLD | NEW |