| 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/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/native_window_notification_source.h" | 9 #include "chrome/browser/native_window_notification_source.h" |
| 10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 ExceededDragThreshold(delta_x, delta_y)) { | 465 ExceededDragThreshold(delta_x, delta_y)) { |
| 466 // When a drag begins, we do not want to the client area to still receive | 466 // When a drag begins, we do not want to the client area to still receive |
| 467 // the focus. | 467 // the focus. |
| 468 old_focused_view_ = GetFocusManager()->GetFocusedView(); | 468 old_focused_view_ = GetFocusManager()->GetFocusedView(); |
| 469 GetFocusManager()->SetFocusedView(GetFrameView()); | 469 GetFocusManager()->SetFocusedView(GetFrameView()); |
| 470 | 470 |
| 471 panel_->manager()->StartDragging(panel_.get()); | 471 panel_->manager()->StartDragging(panel_.get()); |
| 472 mouse_dragging_state_ = DRAGGING_STARTED; | 472 mouse_dragging_state_ = DRAGGING_STARTED; |
| 473 } | 473 } |
| 474 if (mouse_dragging_state_ == DRAGGING_STARTED) | 474 if (mouse_dragging_state_ == DRAGGING_STARTED) |
| 475 panel_->manager()->Drag(delta_x); | 475 panel_->manager()->Drag(delta_x, delta_y); |
| 476 return true; | 476 return true; |
| 477 } | 477 } |
| 478 | 478 |
| 479 bool PanelBrowserView::OnTitlebarMouseReleased() { | 479 bool PanelBrowserView::OnTitlebarMouseReleased() { |
| 480 if (mouse_dragging_state_ == DRAGGING_STARTED) { | 480 if (mouse_dragging_state_ == DRAGGING_STARTED) { |
| 481 // When a drag ends, restore the focus. | 481 // When a drag ends, restore the focus. |
| 482 if (old_focused_view_) { | 482 if (old_focused_view_) { |
| 483 GetFocusManager()->SetFocusedView(old_focused_view_); | 483 GetFocusManager()->SetFocusedView(old_focused_view_); |
| 484 old_focused_view_ = NULL; | 484 old_focused_view_ = NULL; |
| 485 } | 485 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 } | 631 } |
| 632 | 632 |
| 633 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 633 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
| 634 return true; | 634 return true; |
| 635 } | 635 } |
| 636 | 636 |
| 637 bool NativePanelTestingWin::IsAnimatingBounds() const { | 637 bool NativePanelTestingWin::IsAnimatingBounds() const { |
| 638 return panel_browser_view_->bounds_animator_.get() && | 638 return panel_browser_view_->bounds_animator_.get() && |
| 639 panel_browser_view_->bounds_animator_->is_animating(); | 639 panel_browser_view_->bounds_animator_->is_animating(); |
| 640 } | 640 } |
| OLD | NEW |