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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/win_util.h" | 12 #include "base/win_util.h" |
13 #include "grit/app_strings.h" | 13 #include "grit/app_strings.h" |
14 #include "skia/ext/skia_utils_win.h" | 14 #include "skia/ext/skia_utils_win.h" |
15 #include "views/controls/hwnd_view.h" | |
16 #include "views/controls/menu/menu_win.h" | 15 #include "views/controls/menu/menu_win.h" |
| 16 #include "views/controls/native/native_view_host.h" |
17 #include "views/controls/textfield/native_textfield_win.h" | 17 #include "views/controls/textfield/native_textfield_win.h" |
18 #include "views/controls/textfield/textfield.h" | 18 #include "views/controls/textfield/textfield.h" |
19 #include "views/focus/focus_util_win.h" | 19 #include "views/focus/focus_util_win.h" |
20 #include "views/views_delegate.h" | 20 #include "views/views_delegate.h" |
21 #include "views/widget/widget.h" | 21 #include "views/widget/widget.h" |
22 | 22 |
23 namespace views { | 23 namespace views { |
24 | 24 |
25 /////////////////////////////////////////////////////////////////////////////// | 25 /////////////////////////////////////////////////////////////////////////////// |
26 // Helper classes | 26 // Helper classes |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 l10n_util::GetString(IDS_APP_CUT)); | 104 l10n_util::GetString(IDS_APP_CUT)); |
105 context_menu_->AppendMenuItemWithLabel(IDS_APP_COPY, | 105 context_menu_->AppendMenuItemWithLabel(IDS_APP_COPY, |
106 l10n_util::GetString(IDS_APP_COPY)); | 106 l10n_util::GetString(IDS_APP_COPY)); |
107 context_menu_->AppendMenuItemWithLabel(IDS_APP_PASTE, | 107 context_menu_->AppendMenuItemWithLabel(IDS_APP_PASTE, |
108 l10n_util::GetString(IDS_APP_PASTE)); | 108 l10n_util::GetString(IDS_APP_PASTE)); |
109 context_menu_->AppendSeparator(); | 109 context_menu_->AppendSeparator(); |
110 context_menu_->AppendMenuItemWithLabel( | 110 context_menu_->AppendMenuItemWithLabel( |
111 IDS_APP_SELECT_ALL, | 111 IDS_APP_SELECT_ALL, |
112 l10n_util::GetString(IDS_APP_SELECT_ALL)); | 112 l10n_util::GetString(IDS_APP_SELECT_ALL)); |
113 | 113 |
114 container_view_ = new HWNDView; | 114 container_view_ = new NativeViewHost; |
115 textfield_->AddChildView(container_view_); | 115 textfield_->AddChildView(container_view_); |
116 container_view_->SetAssociatedFocusView(textfield_); | 116 container_view_->set_focus_view(textfield_); |
117 container_view_->Attach(m_hWnd); | 117 container_view_->Attach(m_hWnd); |
118 } | 118 } |
119 | 119 |
120 NativeTextfieldWin::~NativeTextfieldWin() { | 120 NativeTextfieldWin::~NativeTextfieldWin() { |
121 if (IsWindow()) | 121 if (IsWindow()) |
122 DestroyWindow(); | 122 DestroyWindow(); |
123 } | 123 } |
124 | 124 |
125 //////////////////////////////////////////////////////////////////////////////// | 125 //////////////////////////////////////////////////////////////////////////////// |
126 // NativeTextfieldWin, NativeTextfieldWrapper implementation: | 126 // NativeTextfieldWin, NativeTextfieldWrapper implementation: |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 //////////////////////////////////////////////////////////////////////////////// | 823 //////////////////////////////////////////////////////////////////////////////// |
824 // NativeTextfieldWrapper, public: | 824 // NativeTextfieldWrapper, public: |
825 | 825 |
826 // static | 826 // static |
827 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 827 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
828 Textfield* field) { | 828 Textfield* field) { |
829 return new NativeTextfieldWin(field); | 829 return new NativeTextfieldWin(field); |
830 } | 830 } |
831 | 831 |
832 } // namespace views | 832 } // namespace views |
OLD | NEW |