OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <gdk/gdkkeysyms.h> | 5 #include <gdk/gdkkeysyms.h> |
6 #include <gtk/gtk.h> | 6 #include <gtk/gtk.h> |
7 | 7 |
8 #include "views/controls/textfield/native_textfield_gtk.h" | 8 #include "views/controls/textfield/native_textfield_gtk.h" |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 242 } |
243 | 243 |
244 gfx::NativeView NativeTextfieldGtk::GetTestingHandle() const { | 244 gfx::NativeView NativeTextfieldGtk::GetTestingHandle() const { |
245 return native_view(); | 245 return native_view(); |
246 } | 246 } |
247 | 247 |
248 bool NativeTextfieldGtk::IsIMEComposing() const { | 248 bool NativeTextfieldGtk::IsIMEComposing() const { |
249 return false; | 249 return false; |
250 } | 250 } |
251 | 251 |
252 void NativeTextfieldGtk::GetSelectionModel(gfx::SelectionModel* sel) const { | 252 void NativeTextfieldGtk::GetSelectedRange(ui::Range* range) const { |
253 gint start_pos; | 253 gint start_pos; |
254 gint end_pos; | 254 gint end_pos; |
255 gtk_editable_get_selection_bounds( | 255 gtk_editable_get_selection_bounds( |
256 GTK_EDITABLE(native_view()), &start_pos, &end_pos); | 256 GTK_EDITABLE(native_view()), &start_pos, &end_pos); |
257 *sel = gfx::SelectionModel(start_pos, end_pos); | 257 *range = ui::Range(start_pos, end_pos); |
| 258 } |
| 259 |
| 260 void NativeTextfieldGtk::SelectRange(const ui::Range& range) { |
| 261 NOTREACHED(); |
| 262 } |
| 263 |
| 264 void NativeTextfieldGtk::GetSelectionModel(gfx::SelectionModel* sel) const { |
| 265 NOTREACHED(); |
258 } | 266 } |
259 | 267 |
260 void NativeTextfieldGtk::SelectSelectionModel(const gfx::SelectionModel& sel) { | 268 void NativeTextfieldGtk::SelectSelectionModel(const gfx::SelectionModel& sel) { |
261 NOTREACHED(); | 269 NOTREACHED(); |
262 } | 270 } |
263 | 271 |
264 size_t NativeTextfieldGtk::GetCursorPosition() const { | 272 size_t NativeTextfieldGtk::GetCursorPosition() const { |
265 NOTREACHED(); | 273 NOTREACHED(); |
266 return 0U; | 274 return 0U; |
267 } | 275 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 429 |
422 // static | 430 // static |
423 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 431 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
424 Textfield* field) { | 432 Textfield* field) { |
425 if (Widget::IsPureViews()) | 433 if (Widget::IsPureViews()) |
426 return new NativeTextfieldViews(field); | 434 return new NativeTextfieldViews(field); |
427 return new NativeTextfieldGtk(field); | 435 return new NativeTextfieldGtk(field); |
428 } | 436 } |
429 | 437 |
430 } // namespace views | 438 } // namespace views |
OLD | NEW |