| 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/view.h" | 5 #include "ui/views/view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1951 // NOTREACHED assertion and verify accelerators works as | 1951 // NOTREACHED assertion and verify accelerators works as |
| 1952 // expected. | 1952 // expected. |
| 1953 #if defined(OS_WIN) | 1953 #if defined(OS_WIN) |
| 1954 NOTREACHED(); | 1954 NOTREACHED(); |
| 1955 #endif | 1955 #endif |
| 1956 return; | 1956 return; |
| 1957 } | 1957 } |
| 1958 for (std::vector<ui::Accelerator>::const_iterator i( | 1958 for (std::vector<ui::Accelerator>::const_iterator i( |
| 1959 accelerators_->begin() + registered_accelerator_count_); | 1959 accelerators_->begin() + registered_accelerator_count_); |
| 1960 i != accelerators_->end(); ++i) { | 1960 i != accelerators_->end(); ++i) { |
| 1961 accelerator_focus_manager_->RegisterAccelerator(*i, this); | 1961 accelerator_focus_manager_->RegisterAccelerator( |
| 1962 *i, ui::AcceleratorManager::kNormalPriority, this); |
| 1962 } | 1963 } |
| 1963 registered_accelerator_count_ = accelerators_->size(); | 1964 registered_accelerator_count_ = accelerators_->size(); |
| 1964 } | 1965 } |
| 1965 | 1966 |
| 1966 void View::UnregisterAccelerators(bool leave_data_intact) { | 1967 void View::UnregisterAccelerators(bool leave_data_intact) { |
| 1967 if (!accelerators_.get()) | 1968 if (!accelerators_.get()) |
| 1968 return; | 1969 return; |
| 1969 | 1970 |
| 1970 if (GetWidget()) { | 1971 if (GetWidget()) { |
| 1971 if (accelerator_focus_manager_) { | 1972 if (accelerator_focus_manager_) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2065 | 2066 |
| 2066 // Message the RootView to do the drag and drop. That way if we're removed | 2067 // Message the RootView to do the drag and drop. That way if we're removed |
| 2067 // the RootView can detect it and avoid calling us back. | 2068 // the RootView can detect it and avoid calling us back. |
| 2068 gfx::Point widget_location(event.location()); | 2069 gfx::Point widget_location(event.location()); |
| 2069 ConvertPointToWidget(this, &widget_location); | 2070 ConvertPointToWidget(this, &widget_location); |
| 2070 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); | 2071 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); |
| 2071 #endif // !defined(OS_MACOSX) | 2072 #endif // !defined(OS_MACOSX) |
| 2072 } | 2073 } |
| 2073 | 2074 |
| 2074 } // namespace views | 2075 } // namespace views |
| OLD | NEW |