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

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

Issue 24012002: Move Range code to gfx. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: d Created 7 years, 3 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
OLDNEW
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/win/metro.h" 13 #include "base/win/metro.h"
14 #include "base/win/windows_version.h" 14 #include "base/win/windows_version.h"
15 #include "grit/ui_strings.h" 15 #include "grit/ui_strings.h"
16 #include "skia/ext/skia_utils_win.h" 16 #include "skia/ext/skia_utils_win.h"
17 #include "ui/base/accessibility/accessible_view_state.h" 17 #include "ui/base/accessibility/accessible_view_state.h"
18 #include "ui/base/clipboard/clipboard.h" 18 #include "ui/base/clipboard/clipboard.h"
19 #include "ui/base/clipboard/scoped_clipboard_writer.h" 19 #include "ui/base/clipboard/scoped_clipboard_writer.h"
20 #include "ui/base/events/event.h" 20 #include "ui/base/events/event.h"
21 #include "ui/base/ime/win/tsf_bridge.h" 21 #include "ui/base/ime/win/tsf_bridge.h"
22 #include "ui/base/keycodes/keyboard_codes.h" 22 #include "ui/base/keycodes/keyboard_codes.h"
23 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/l10n/l10n_util_win.h" 24 #include "ui/base/l10n/l10n_util_win.h"
25 #include "ui/base/range/range.h"
26 #include "ui/base/win/hwnd_util.h" 25 #include "ui/base/win/hwnd_util.h"
27 #include "ui/base/win/mouse_wheel_util.h" 26 #include "ui/base/win/mouse_wheel_util.h"
27 #include "ui/gfx/range/range.h"
28 #include "ui/native_theme/native_theme_win.h" 28 #include "ui/native_theme/native_theme_win.h"
29 #include "ui/views/controls/label.h" 29 #include "ui/views/controls/label.h"
30 #include "ui/views/controls/menu/menu_item_view.h" 30 #include "ui/views/controls/menu/menu_item_view.h"
31 #include "ui/views/controls/menu/menu_model_adapter.h" 31 #include "ui/views/controls/menu/menu_model_adapter.h"
32 #include "ui/views/controls/menu/menu_runner.h" 32 #include "ui/views/controls/menu/menu_runner.h"
33 #include "ui/views/controls/native/native_view_host.h" 33 #include "ui/views/controls/native/native_view_host.h"
34 #include "ui/views/controls/textfield/textfield.h" 34 #include "ui/views/controls/textfield/textfield.h"
35 #include "ui/views/controls/textfield/textfield_controller.h" 35 #include "ui/views/controls/textfield/textfield_controller.h"
36 #include "ui/views/focus/focus_manager.h" 36 #include "ui/views/focus/focus_manager.h"
37 #include "ui/views/metrics.h" 37 #include "ui/views/metrics.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 HIMC imm_context = ImmGetContext(m_hWnd); 333 HIMC imm_context = ImmGetContext(m_hWnd);
334 if (!imm_context) 334 if (!imm_context)
335 return false; 335 return false;
336 336
337 const int composition_size = ImmGetCompositionString(imm_context, GCS_COMPSTR, 337 const int composition_size = ImmGetCompositionString(imm_context, GCS_COMPSTR,
338 NULL, 0); 338 NULL, 0);
339 ImmReleaseContext(m_hWnd, imm_context); 339 ImmReleaseContext(m_hWnd, imm_context);
340 return composition_size > 0; 340 return composition_size > 0;
341 } 341 }
342 342
343 ui::Range NativeTextfieldWin::GetSelectedRange() const { 343 gfx::Range NativeTextfieldWin::GetSelectedRange() const {
344 // TODO(tommi): Implement. 344 // TODO(tommi): Implement.
345 NOTIMPLEMENTED(); 345 NOTIMPLEMENTED();
346 return ui::Range(); 346 return gfx::Range();
347 } 347 }
348 348
349 void NativeTextfieldWin::SelectRange(const ui::Range& range) { 349 void NativeTextfieldWin::SelectRange(const gfx::Range& range) {
350 // TODO(tommi): Implement. 350 // TODO(tommi): Implement.
351 NOTIMPLEMENTED(); 351 NOTIMPLEMENTED();
352 } 352 }
353 353
354 gfx::SelectionModel NativeTextfieldWin::GetSelectionModel() const { 354 gfx::SelectionModel NativeTextfieldWin::GetSelectionModel() const {
355 // TODO(tommi): Implement. 355 // TODO(tommi): Implement.
356 NOTIMPLEMENTED(); 356 NOTIMPLEMENTED();
357 return gfx::SelectionModel(); 357 return gfx::SelectionModel();
358 } 358 }
359 359
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 394 }
395 395
396 ui::TextInputClient* NativeTextfieldWin::GetTextInputClient() { 396 ui::TextInputClient* NativeTextfieldWin::GetTextInputClient() {
397 return NULL; 397 return NULL;
398 } 398 }
399 399
400 void NativeTextfieldWin::SetColor(SkColor value) { 400 void NativeTextfieldWin::SetColor(SkColor value) {
401 NOTREACHED(); 401 NOTREACHED();
402 } 402 }
403 403
404 void NativeTextfieldWin::ApplyColor(SkColor value, const ui::Range& range) { 404 void NativeTextfieldWin::ApplyColor(SkColor value, const gfx::Range& range) {
405 NOTREACHED(); 405 NOTREACHED();
406 } 406 }
407 407
408 void NativeTextfieldWin::SetStyle(gfx::TextStyle style, bool value) { 408 void NativeTextfieldWin::SetStyle(gfx::TextStyle style, bool value) {
409 NOTREACHED(); 409 NOTREACHED();
410 } 410 }
411 411
412 void NativeTextfieldWin::ApplyStyle(gfx::TextStyle style, 412 void NativeTextfieldWin::ApplyStyle(gfx::TextStyle style,
413 bool value, 413 bool value,
414 const ui::Range& range) { 414 const gfx::Range& range) {
415 NOTREACHED(); 415 NOTREACHED();
416 } 416 }
417 417
418 void NativeTextfieldWin::ClearEditHistory() { 418 void NativeTextfieldWin::ClearEditHistory() {
419 NOTREACHED(); 419 NOTREACHED();
420 } 420 }
421 421
422 int NativeTextfieldWin::GetFontHeight() { 422 int NativeTextfieldWin::GetFontHeight() {
423 return textfield_->font_list().GetHeight(); 423 return textfield_->font_list().GetHeight();
424 } 424 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 case IDS_APP_UNDO: Undo(); break; 486 case IDS_APP_UNDO: Undo(); break;
487 case IDS_APP_CUT: Cut(); break; 487 case IDS_APP_CUT: Cut(); break;
488 case IDS_APP_COPY: Copy(); break; 488 case IDS_APP_COPY: Copy(); break;
489 case IDS_APP_PASTE: Paste(); break; 489 case IDS_APP_PASTE: Paste(); break;
490 case IDS_APP_SELECT_ALL: SelectAll(false); break; 490 case IDS_APP_SELECT_ALL: SelectAll(false); break;
491 default: NOTREACHED(); break; 491 default: NOTREACHED(); break;
492 } 492 }
493 OnAfterPossibleChange(true); 493 OnAfterPossibleChange(true);
494 } 494 }
495 495
496 void NativeTextfieldWin::OnTextUpdated(const ui::Range& composition_range) { 496 void NativeTextfieldWin::OnTextUpdated(const gfx::Range& composition_range) {
497 if (ime_discard_composition_) { 497 if (ime_discard_composition_) {
498 ime_composition_start_ = composition_range.start(); 498 ime_composition_start_ = composition_range.start();
499 ime_composition_length_ = composition_range.length(); 499 ime_composition_length_ = composition_range.length();
500 } else { 500 } else {
501 ime_composition_start_ = 0; 501 ime_composition_start_ = 0;
502 ime_composition_length_ = 0; 502 ime_composition_length_ = 0;
503 } 503 }
504 OnAfterPossibleChange(false); 504 OnAfterPossibleChange(false);
505 text_before_change_.clear(); 505 text_before_change_.clear();
506 } 506 }
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 return true; 1310 return true;
1311 MSG msg(*GetCurrentMessage()); 1311 MSG msg(*GetCurrentMessage());
1312 // ATL doesn't set the |time| field. 1312 // ATL doesn't set the |time| field.
1313 if (!msg.time) 1313 if (!msg.time)
1314 msg.time = GetMessageTime(); 1314 msg.time = GetMessageTime();
1315 ui::MouseEvent mouse_event(msg); 1315 ui::MouseEvent mouse_event(msg);
1316 return !controller->HandleMouseEvent(textfield_, mouse_event); 1316 return !controller->HandleMouseEvent(textfield_, mouse_event);
1317 } 1317 }
1318 1318
1319 } // namespace views 1319 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_win.h ('k') | ui/views/controls/textfield/native_textfield_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698