Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Side by Side Diff: views/controls/textfield/native_textfield_win.cc

Issue 125148: Making FocusManager portable to toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/tabbed_pane.cc ('k') | views/controls/tree/tree_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane.cc ('k') | views/controls/tree/tree_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698