| 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 "ui/views/controls/menu/menu_controller.h" | 5 #include "ui/views/controls/menu/menu_controller.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 bool is_nested_drag, | 394 bool is_nested_drag, |
| 395 int* result_event_flags) { | 395 int* result_event_flags) { |
| 396 exit_type_ = EXIT_NONE; | 396 exit_type_ = EXIT_NONE; |
| 397 possible_drag_ = false; | 397 possible_drag_ = false; |
| 398 drag_in_progress_ = false; | 398 drag_in_progress_ = false; |
| 399 did_initiate_drag_ = false; | 399 did_initiate_drag_ = false; |
| 400 closing_event_time_ = base::TimeTicks(); | 400 closing_event_time_ = base::TimeTicks(); |
| 401 menu_start_time_ = base::TimeTicks::Now(); | 401 menu_start_time_ = base::TimeTicks::Now(); |
| 402 menu_start_mouse_press_loc_ = gfx::Point(); | 402 menu_start_mouse_press_loc_ = gfx::Point(); |
| 403 | 403 |
| 404 // If we are shown on mouse press, we will eat the subsequent mouse down and | |
| 405 // the parent widget will not be able to reset its state (it might have mouse | |
| 406 // capture from the mouse down). So we clear its state here. | |
| 407 if (parent) { | 404 if (parent) { |
| 408 View* root_view = parent->GetRootView(); | 405 View* root_view = parent->GetRootView(); |
| 409 if (root_view) { | 406 if (root_view) { |
| 410 root_view->SetMouseHandler(NULL); | |
| 411 const ui::Event* event = | 407 const ui::Event* event = |
| 412 static_cast<internal::RootView*>(root_view)->current_event(); | 408 static_cast<internal::RootView*>(root_view)->current_event(); |
| 413 if (event && event->type() == ui::ET_MOUSE_PRESSED) { | 409 if (event && event->type() == ui::ET_MOUSE_PRESSED) { |
| 414 gfx::Point screen_loc( | 410 gfx::Point screen_loc( |
| 415 static_cast<const ui::MouseEvent*>(event)->location()); | 411 static_cast<const ui::MouseEvent*>(event)->location()); |
| 416 View::ConvertPointToScreen( | 412 View::ConvertPointToScreen( |
| 417 static_cast<View*>(event->target()), &screen_loc); | 413 static_cast<View*>(event->target()), &screen_loc); |
| 418 menu_start_mouse_press_loc_ = screen_loc; | 414 menu_start_mouse_press_loc_ = screen_loc; |
| 419 } | 415 } |
| 420 } | 416 } |
| (...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2730 if (hot_button_) | 2726 if (hot_button_) |
| 2731 hot_button_->SetHotTracked(false); | 2727 hot_button_->SetHotTracked(false); |
| 2732 hot_button_ = hot_button; | 2728 hot_button_ = hot_button; |
| 2733 if (hot_button) { | 2729 if (hot_button) { |
| 2734 hot_button->SetHotTracked(true); | 2730 hot_button->SetHotTracked(true); |
| 2735 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); | 2731 hot_button->NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); |
| 2736 } | 2732 } |
| 2737 } | 2733 } |
| 2738 | 2734 |
| 2739 } // namespace views | 2735 } // namespace views |
| OLD | NEW |