| 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_browser_view.h" | 5 #include "chrome/browser/ui/panels/panel_browser_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
| 10 #include "chrome/browser/ui/panels/panel_bounds_animation.h" | 10 #include "chrome/browser/ui/panels/panel_bounds_animation.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 base::TimeTicks::Now() - attention_cleared_time_ < | 489 base::TimeTicks::Now() - attention_cleared_time_ < |
| 490 base::TimeDelta::FromMilliseconds(kSuspendMinimizeOnClickIntervalMs)) { | 490 base::TimeDelta::FromMilliseconds(kSuspendMinimizeOnClickIntervalMs)) { |
| 491 return true; | 491 return true; |
| 492 } | 492 } |
| 493 | 493 |
| 494 // Ignore long clicks. Treated as a canceled click to be consistent with Mac. | 494 // Ignore long clicks. Treated as a canceled click to be consistent with Mac. |
| 495 if (base::TimeTicks::Now() - mouse_pressed_time_ > | 495 if (base::TimeTicks::Now() - mouse_pressed_time_ > |
| 496 base::TimeDelta::FromMilliseconds(kShortClickThresholdMs)) | 496 base::TimeDelta::FromMilliseconds(kShortClickThresholdMs)) |
| 497 return true; | 497 return true; |
| 498 | 498 |
| 499 Panel::ExpansionState new_expansion_state = | 499 if (panel_->layout_state() == Panel::IN_OVERFLOW) { |
| 500 (panel_->expansion_state() != Panel::EXPANDED) ? Panel::EXPANDED | 500 panel_->SetExpansionState(Panel::EXPANDED); |
| 501 : Panel::MINIMIZED; | 501 panel_->SetLayoutState(Panel::DOCKED); |
| 502 panel_->SetExpansionState(new_expansion_state); | 502 } else { |
| 503 Panel::ExpansionState new_expansion_state = |
| 504 (panel_->expansion_state() != Panel::EXPANDED) ? Panel::EXPANDED |
| 505 : Panel::MINIMIZED; |
| 506 panel_->SetExpansionState(new_expansion_state); |
| 507 } |
| 508 |
| 503 return true; | 509 return true; |
| 504 } | 510 } |
| 505 | 511 |
| 506 bool PanelBrowserView::OnTitlebarMouseCaptureLost() { | 512 bool PanelBrowserView::OnTitlebarMouseCaptureLost() { |
| 507 if (mouse_dragging_state_ == DRAGGING_STARTED) | 513 if (mouse_dragging_state_ == DRAGGING_STARTED) |
| 508 return EndDragging(true); | 514 return EndDragging(true); |
| 509 return true; | 515 return true; |
| 510 } | 516 } |
| 511 | 517 |
| 512 bool PanelBrowserView::EndDragging(bool cancelled) { | 518 bool PanelBrowserView::EndDragging(bool cancelled) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 } | 624 } |
| 619 | 625 |
| 620 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 626 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
| 621 return true; | 627 return true; |
| 622 } | 628 } |
| 623 | 629 |
| 624 bool NativePanelTestingWin::IsAnimatingBounds() const { | 630 bool NativePanelTestingWin::IsAnimatingBounds() const { |
| 625 return panel_browser_view_->bounds_animator_.get() && | 631 return panel_browser_view_->bounds_animator_.get() && |
| 626 panel_browser_view_->bounds_animator_->is_animating(); | 632 panel_browser_view_->bounds_animator_->is_animating(); |
| 627 } | 633 } |
| OLD | NEW |