| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "app/l10n_util_win.h" | 6 #include "app/l10n_util_win.h" |
| 7 #include "app/win_util.h" | 7 #include "app/win_util.h" |
| 8 #include "base/clipboard.h" | 8 #include "base/clipboard.h" |
| 9 #include "base/gfx/native_theme.h" | 9 #include "base/gfx/native_theme.h" |
| 10 #include "base/scoped_clipboard_writer.h" | 10 #include "base/scoped_clipboard_writer.h" |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 // Force a Paste operation to trigger OnContentsChanged, even if identical | 674 // Force a Paste operation to trigger OnContentsChanged, even if identical |
| 675 // contents are pasted into the text box. | 675 // contents are pasted into the text box. |
| 676 text_before_change_.clear(); | 676 text_before_change_.clear(); |
| 677 ReplaceSel(collapsed.c_str(), true); | 677 ReplaceSel(collapsed.c_str(), true); |
| 678 } | 678 } |
| 679 } | 679 } |
| 680 | 680 |
| 681 void NativeTextfieldWin::OnSetFocus(HWND hwnd) { | 681 void NativeTextfieldWin::OnSetFocus(HWND hwnd) { |
| 682 SetMsgHandled(FALSE); // We still want the default processing of the message. | 682 SetMsgHandled(FALSE); // We still want the default processing of the message. |
| 683 | 683 |
| 684 views::FocusManager* focus_manager = | 684 views::FocusManager* focus_manager = textfield_->GetFocusManager(); |
| 685 views::FocusManager::GetFocusManager(m_hWnd); | |
| 686 if (!focus_manager) { | 685 if (!focus_manager) { |
| 687 NOTREACHED(); | 686 NOTREACHED(); |
| 688 return; | 687 return; |
| 689 } | 688 } |
| 690 focus_manager->SetFocusedView(textfield_); | 689 focus_manager->SetFocusedView(textfield_); |
| 691 } | 690 } |
| 692 | 691 |
| 693 void NativeTextfieldWin::OnSysChar(TCHAR ch, UINT repeat_count, UINT flags) { | 692 void NativeTextfieldWin::OnSysChar(TCHAR ch, UINT repeat_count, UINT flags) { |
| 694 // Nearly all alt-<xxx> combos result in beeping rather than doing something | 693 // Nearly all alt-<xxx> combos result in beeping rather than doing something |
| 695 // useful, so we discard most. Exceptions: | 694 // useful, so we discard most. Exceptions: |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 //////////////////////////////////////////////////////////////////////////////// | 864 //////////////////////////////////////////////////////////////////////////////// |
| 866 // NativeTextfieldWrapper, public: | 865 // NativeTextfieldWrapper, public: |
| 867 | 866 |
| 868 // static | 867 // static |
| 869 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 868 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 870 Textfield* field) { | 869 Textfield* field) { |
| 871 return new NativeTextfieldWin(field); | 870 return new NativeTextfieldWin(field); |
| 872 } | 871 } |
| 873 | 872 |
| 874 } // namespace views | 873 } // namespace views |
| OLD | NEW |