| 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 "views/view.h" | 5 #include "views/view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 | 836 |
| 837 bool View::OnMouseWheel(const MouseWheelEvent& event) { | 837 bool View::OnMouseWheel(const MouseWheelEvent& event) { |
| 838 return false; | 838 return false; |
| 839 } | 839 } |
| 840 | 840 |
| 841 TextInputClient* View::GetTextInputClient() { | 841 TextInputClient* View::GetTextInputClient() { |
| 842 return NULL; | 842 return NULL; |
| 843 } | 843 } |
| 844 | 844 |
| 845 InputMethod* View::GetInputMethod() { | 845 InputMethod* View::GetInputMethod() { |
| 846 // TODO(suzhe): Implement it. | 846 Widget* widget = GetWidget(); |
| 847 return NULL; | 847 return widget ? widget->GetInputMethod() : NULL; |
| 848 } | 848 } |
| 849 | 849 |
| 850 // Accelerators ---------------------------------------------------------------- | 850 // Accelerators ---------------------------------------------------------------- |
| 851 | 851 |
| 852 void View::AddAccelerator(const Accelerator& accelerator) { | 852 void View::AddAccelerator(const Accelerator& accelerator) { |
| 853 if (!accelerators_.get()) | 853 if (!accelerators_.get()) |
| 854 accelerators_.reset(new std::vector<Accelerator>()); | 854 accelerators_.reset(new std::vector<Accelerator>()); |
| 855 | 855 |
| 856 std::vector<Accelerator>::iterator iter = | 856 std::vector<Accelerator>::iterator iter = |
| 857 std::find(accelerators_->begin(), accelerators_->end(), accelerator); | 857 std::find(accelerators_->begin(), accelerators_->end(), accelerator); |
| (...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 | 1728 |
| 1729 OSExchangeData data; | 1729 OSExchangeData data; |
| 1730 WriteDragData(press_pt, &data); | 1730 WriteDragData(press_pt, &data); |
| 1731 | 1731 |
| 1732 // Message the RootView to do the drag and drop. That way if we're removed | 1732 // Message the RootView to do the drag and drop. That way if we're removed |
| 1733 // the RootView can detect it and avoid calling us back. | 1733 // the RootView can detect it and avoid calling us back. |
| 1734 GetWidget()->RunShellDrag(this, data, drag_operations); | 1734 GetWidget()->RunShellDrag(this, data, drag_operations); |
| 1735 } | 1735 } |
| 1736 | 1736 |
| 1737 } // namespace views | 1737 } // namespace views |
| OLD | NEW |