| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/widget/root_view.h" | 5 #include "chrome/views/widget/root_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include "base/base_drag_source.h" | 10 #include "base/base_drag_source.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 395 |
| 396 bool RootView::OnMouseDragged(const MouseEvent& e) { | 396 bool RootView::OnMouseDragged(const MouseEvent& e) { |
| 397 UpdateCursor(e); | 397 UpdateCursor(e); |
| 398 | 398 |
| 399 if (mouse_pressed_handler_) { | 399 if (mouse_pressed_handler_) { |
| 400 SetMouseLocationAndFlags(e); | 400 SetMouseLocationAndFlags(e); |
| 401 | 401 |
| 402 gfx::Point p; | 402 gfx::Point p; |
| 403 ConvertPointToMouseHandler(e.location(), &p); | 403 ConvertPointToMouseHandler(e.location(), &p); |
| 404 MouseEvent mouse_event(e.GetType(), p.x(), p.y(), e.GetFlags()); | 404 MouseEvent mouse_event(e.GetType(), p.x(), p.y(), e.GetFlags()); |
| 405 if (!mouse_pressed_handler_->ProcessMouseDragged(mouse_event, | 405 return mouse_pressed_handler_->ProcessMouseDragged(mouse_event, &drag_info); |
| 406 &drag_info)) { | |
| 407 mouse_pressed_handler_ = NULL; | |
| 408 return false; | |
| 409 } else { | |
| 410 return true; | |
| 411 } | |
| 412 } | 406 } |
| 413 return false; | 407 return false; |
| 414 } | 408 } |
| 415 | 409 |
| 416 void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) { | 410 void RootView::OnMouseReleased(const MouseEvent& e, bool canceled) { |
| 417 UpdateCursor(e); | 411 UpdateCursor(e); |
| 418 | 412 |
| 419 if (mouse_pressed_handler_) { | 413 if (mouse_pressed_handler_) { |
| 420 gfx::Point p; | 414 gfx::Point p; |
| 421 ConvertPointToMouseHandler(e.location(), &p); | 415 ConvertPointToMouseHandler(e.location(), &p); |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 970 |
| 977 void RootView::SetAccessibleName(const std::wstring& name) { | 971 void RootView::SetAccessibleName(const std::wstring& name) { |
| 978 accessible_name_.assign(name); | 972 accessible_name_.assign(name); |
| 979 } | 973 } |
| 980 | 974 |
| 981 View* RootView::GetDragView() { | 975 View* RootView::GetDragView() { |
| 982 return drag_view_; | 976 return drag_view_; |
| 983 } | 977 } |
| 984 | 978 |
| 985 } // namespace views | 979 } // namespace views |
| OLD | NEW |