| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 task_delay_milliseconds = | 422 task_delay_milliseconds = |
| 423 kMaxMillisecondsWaitForBottomBarVisibilityChange; | 423 kMaxMillisecondsWaitForBottomBarVisibilityChange; |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 // On some OSes, the interaction with native Taskbars/Docks may be improved | 427 // On some OSes, the interaction with native Taskbars/Docks may be improved |
| 428 // if the panels do not go back to minimized state too fast. For example, | 428 // if the panels do not go back to minimized state too fast. For example, |
| 429 // it makes it possible to hit the titlebar on OSX if Dock has Magnifying | 429 // it makes it possible to hit the titlebar on OSX if Dock has Magnifying |
| 430 // enabled - the panels stay up for a while after Dock magnification effect | 430 // enabled - the panels stay up for a while after Dock magnification effect |
| 431 // stops covering the panels. | 431 // stops covering the panels. |
| 432 // TODO(dimich): when there is implementation which has both delays to be | 432 // Currently, no platforms use both delays. |
| 433 // different from zero, figure out what shoudl be the combined delay. | 433 DCHECK(task_delay_milliseconds == 0); |
| 434 if (!bring_up && | 434 if (!bring_up) |
| 435 task_delay_milliseconds < kMillisecondsBeforeCollapsingFromTitleOnlyState) | |
| 436 task_delay_milliseconds = kMillisecondsBeforeCollapsingFromTitleOnlyState; | 435 task_delay_milliseconds = kMillisecondsBeforeCollapsingFromTitleOnlyState; |
| 437 | 436 |
| 438 // OnAutoHidingDesktopBarVisibilityChanged will handle this. | 437 // OnAutoHidingDesktopBarVisibilityChanged will handle this. |
| 439 delayed_titlebar_action_ = bring_up ? BRING_UP : BRING_DOWN; | 438 delayed_titlebar_action_ = bring_up ? BRING_UP : BRING_DOWN; |
| 440 if (remove_delays_for_testing_) | 439 if (remove_delays_for_testing_) |
| 441 task_delay_milliseconds = 0; | 440 task_delay_milliseconds = 0; |
| 442 | 441 |
| 443 // If user moves the mouse in and out of mouse tracking area, we might have | 442 // If user moves the mouse in and out of mouse tracking area, we might have |
| 444 // previously posted but not yet dispatched task in the queue. New action | 443 // previously posted but not yet dispatched task in the queue. New action |
| 445 // shoudl always 'reset' the delays so cancel the old task and post a new one. | 444 // shoudl always 'reset' the delays so cancel the old task and post a new one. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 // Start from the bottom to avoid reshuffling. | 596 // Start from the bottom to avoid reshuffling. |
| 598 for (Panels::reverse_iterator iter = panels_copy.rbegin(); | 597 for (Panels::reverse_iterator iter = panels_copy.rbegin(); |
| 599 iter != panels_copy.rend(); ++iter) | 598 iter != panels_copy.rend(); ++iter) |
| 600 (*iter)->Close(); | 599 (*iter)->Close(); |
| 601 } | 600 } |
| 602 | 601 |
| 603 bool PanelManager::is_dragging_panel() const { | 602 bool PanelManager::is_dragging_panel() const { |
| 604 return dragging_panel_index_ != kInvalidPanelIndex; | 603 return dragging_panel_index_ != kInvalidPanelIndex; |
| 605 } | 604 } |
| 606 | 605 |
| OLD | NEW |