| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/panels/panel.h" | 8 #include "chrome/browser/ui/panels/panel.h" |
| 9 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" | 9 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" |
| 10 #include "chrome/browser/ui/panels/panel_manager.h" | 10 #include "chrome/browser/ui/panels/panel_manager.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return false; | 80 return false; |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool PanelBrowserView::CanMaximize() const { | 83 bool PanelBrowserView::CanMaximize() const { |
| 84 return false; | 84 return false; |
| 85 } | 85 } |
| 86 | 86 |
| 87 void PanelBrowserView::SetBounds(const gfx::Rect& bounds) { | 87 void PanelBrowserView::SetBounds(const gfx::Rect& bounds) { |
| 88 bounds_ = bounds; | 88 bounds_ = bounds; |
| 89 | 89 |
| 90 //// No animation if the panel is being dragged. | 90 // No animation if the panel is being dragged. |
| 91 if (mouse_dragging_) { | 91 if (mouse_dragging_) { |
| 92 ::BrowserView::SetBounds(bounds); | 92 ::BrowserView::SetBounds(bounds); |
| 93 return; | 93 return; |
| 94 } | 94 } |
| 95 | 95 |
| 96 animation_start_bounds_ = GetBounds(); | 96 animation_start_bounds_ = GetBounds(); |
| 97 | 97 |
| 98 if (!bounds_animator_.get()) { | 98 if (!bounds_animator_.get()) { |
| 99 bounds_animator_.reset(new ui::SlideAnimation(this)); | 99 bounds_animator_.reset(new ui::SlideAnimation(this)); |
| 100 bounds_animator_->SetSlideDuration(kSetBoundsAnimationMs); | 100 bounds_animator_->SetSlideDuration(kSetBoundsAnimationMs); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 #if defined(OS_WIN) | 203 #if defined(OS_WIN) |
| 204 EnsureMouseWatcherStarted(); | 204 EnsureMouseWatcherStarted(); |
| 205 #endif | 205 #endif |
| 206 break; | 206 break; |
| 207 default: | 207 default: |
| 208 NOTREACHED(); | 208 NOTREACHED(); |
| 209 height = original_height_; | 209 height = original_height_; |
| 210 break; | 210 break; |
| 211 } | 211 } |
| 212 | 212 |
| 213 int bottom = panel_->manager()->GetBottomPositionPerExpansionState( |
| 214 expansion_state); |
| 213 gfx::Rect bounds = bounds_; | 215 gfx::Rect bounds = bounds_; |
| 214 bounds.set_y(bounds.y() + bounds.height() - height); | 216 bounds.set_y(bottom - height); |
| 215 bounds.set_height(height); | 217 bounds.set_height(height); |
| 216 SetBounds(bounds); | 218 SetBounds(bounds); |
| 217 } | 219 } |
| 218 | 220 |
| 219 bool PanelBrowserView::ShouldBringUpPanelTitleBar(int mouse_x, | 221 bool PanelBrowserView::ShouldBringUpPanelTitleBar(int mouse_x, |
| 220 int mouse_y) const { | 222 int mouse_y) const { |
| 221 // We do not want to bring up other minimized panels if the mouse is over the | 223 // We do not want to bring up other minimized panels if the mouse is over the |
| 222 // panel that pops up the title-bar to attract attention. | 224 // panel that pops up the title-bar to attract attention. |
| 223 if (is_drawing_attention_) | 225 if (is_drawing_attention_) |
| 224 return false; | 226 return false; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 current_bounds.x() + delta_x, current_bounds.y() + delta_y)); | 416 current_bounds.x() + delta_x, current_bounds.y() + delta_y)); |
| 415 } | 417 } |
| 416 | 418 |
| 417 void NativePanelTestingWin::CancelDragTitlebar() { | 419 void NativePanelTestingWin::CancelDragTitlebar() { |
| 418 panel_browser_view_->OnTitleBarMouseCaptureLost(); | 420 panel_browser_view_->OnTitleBarMouseCaptureLost(); |
| 419 } | 421 } |
| 420 | 422 |
| 421 void NativePanelTestingWin::FinishDragTitlebar() { | 423 void NativePanelTestingWin::FinishDragTitlebar() { |
| 422 panel_browser_view_->OnTitleBarMouseReleased(); | 424 panel_browser_view_->OnTitleBarMouseReleased(); |
| 423 } | 425 } |
| OLD | NEW |