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/controls/textfield/native_textfield_win.h" | 5 #include "ui/views/controls/textfield/native_textfield_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 skia::SkColorToCOLORREF(textfield_->GetBackgroundColor())); | 244 skia::SkColorToCOLORREF(textfield_->GetBackgroundColor())); |
245 } | 245 } |
246 | 246 |
247 void NativeTextfieldWin::UpdateReadOnly() { | 247 void NativeTextfieldWin::UpdateReadOnly() { |
248 SendMessage(m_hWnd, EM_SETREADONLY, textfield_->read_only(), 0); | 248 SendMessage(m_hWnd, EM_SETREADONLY, textfield_->read_only(), 0); |
249 UpdateAccessibleState(STATE_SYSTEM_READONLY, textfield_->read_only()); | 249 UpdateAccessibleState(STATE_SYSTEM_READONLY, textfield_->read_only()); |
250 } | 250 } |
251 | 251 |
252 void NativeTextfieldWin::UpdateFont() { | 252 void NativeTextfieldWin::UpdateFont() { |
253 SendMessage(m_hWnd, WM_SETFONT, | 253 SendMessage(m_hWnd, WM_SETFONT, |
254 reinterpret_cast<WPARAM>(textfield_->font().GetNativeFont()), | 254 reinterpret_cast<WPARAM>( |
| 255 textfield_->GetPrimaryFont().GetNativeFont()), |
255 TRUE); | 256 TRUE); |
256 // Setting the font blows away any text color we've set, so reset it. | 257 // Setting the font blows away any text color we've set, so reset it. |
257 UpdateTextColor(); | 258 UpdateTextColor(); |
258 } | 259 } |
259 | 260 |
260 void NativeTextfieldWin::UpdateIsObscured() { | 261 void NativeTextfieldWin::UpdateIsObscured() { |
261 // TODO: Need to implement for Windows. | 262 // TODO: Need to implement for Windows. |
262 UpdateAccessibleState(STATE_SYSTEM_PROTECTED, textfield_->IsObscured()); | 263 UpdateAccessibleState(STATE_SYSTEM_PROTECTED, textfield_->IsObscured()); |
263 } | 264 } |
264 | 265 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 bool value, | 413 bool value, |
413 const ui::Range& range) { | 414 const ui::Range& range) { |
414 NOTREACHED(); | 415 NOTREACHED(); |
415 } | 416 } |
416 | 417 |
417 void NativeTextfieldWin::ClearEditHistory() { | 418 void NativeTextfieldWin::ClearEditHistory() { |
418 NOTREACHED(); | 419 NOTREACHED(); |
419 } | 420 } |
420 | 421 |
421 int NativeTextfieldWin::GetFontHeight() { | 422 int NativeTextfieldWin::GetFontHeight() { |
422 return textfield_->font().GetHeight(); | 423 return textfield_->font_list().GetHeight(); |
423 } | 424 } |
424 | 425 |
425 int NativeTextfieldWin::GetTextfieldBaseline() const { | 426 int NativeTextfieldWin::GetTextfieldBaseline() const { |
426 return textfield_->font().GetBaseline(); | 427 return textfield_->font_list().GetBaseline(); |
427 } | 428 } |
428 | 429 |
429 int NativeTextfieldWin::GetWidthNeededForText() const { | 430 int NativeTextfieldWin::GetWidthNeededForText() const { |
430 NOTIMPLEMENTED(); | 431 NOTIMPLEMENTED(); |
431 return 0; | 432 return 0; |
432 } | 433 } |
433 | 434 |
434 void NativeTextfieldWin::ExecuteTextCommand(int command_id) { | 435 void NativeTextfieldWin::ExecuteTextCommand(int command_id) { |
435 ExecuteCommand(command_id, 0); | 436 ExecuteCommand(command_id, 0); |
436 } | 437 } |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 return true; | 1310 return true; |
1310 MSG msg(*GetCurrentMessage()); | 1311 MSG msg(*GetCurrentMessage()); |
1311 // ATL doesn't set the |time| field. | 1312 // ATL doesn't set the |time| field. |
1312 if (!msg.time) | 1313 if (!msg.time) |
1313 msg.time = GetMessageTime(); | 1314 msg.time = GetMessageTime(); |
1314 ui::MouseEvent mouse_event(msg); | 1315 ui::MouseEvent mouse_event(msg); |
1315 return !controller->HandleMouseEvent(textfield_, mouse_event); | 1316 return !controller->HandleMouseEvent(textfield_, mouse_event); |
1316 } | 1317 } |
1317 | 1318 |
1318 } // namespace views | 1319 } // namespace views |
OLD | NEW |