| 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 #ifndef VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
| 6 #define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 class Canvas; | 26 class Canvas; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace views { | 29 namespace views { |
| 30 | 30 |
| 31 class FocusableBorder; | 31 class FocusableBorder; |
| 32 class KeyEvent; | 32 class KeyEvent; |
| 33 class MenuItemView; | 33 class MenuItemView; |
| 34 class MenuModelAdapter; | 34 class MenuModelAdapter; |
| 35 | 35 |
| 36 // TODO(msw): Divide responsibility with RenderText; revise API and fix impls. |
| 37 // TODO(msw): Make RenderText a member of NativeTextfieldViews? |
| 38 |
| 36 // A views/skia only implementation of NativeTextfieldWrapper. | 39 // A views/skia only implementation of NativeTextfieldWrapper. |
| 37 // No platform specific code is used. | 40 // No platform specific code is used. |
| 38 // Following features are not yet supported. | 41 // Following features are not yet supported. |
| 39 // * BIDI/Complex script. | 42 // * BIDI/Complex script. |
| 40 // * Support surrogate pair, or maybe we should just use UTF32 internally. | 43 // * Support surrogate pair, or maybe we should just use UTF32 internally. |
| 41 // * X selection (only if we want to support). | 44 // * X selection (only if we want to support). |
| 42 // Once completed, this will replace Textfield, NativeTextfieldWin and | 45 // Once completed, this will replace Textfield, NativeTextfieldWin and |
| 43 // NativeTextfieldGtk. | 46 // NativeTextfieldGtk. |
| 44 class NativeTextfieldViews : public View, | 47 class NativeTextfieldViews : public View, |
| 45 public ContextMenuController, | 48 public ContextMenuController, |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Checks if a char is ok to be inserted into the textfield. The |ch| is a | 237 // Checks if a char is ok to be inserted into the textfield. The |ch| is a |
| 235 // modified character, i.e., modifiers took effect when generating this char. | 238 // modified character, i.e., modifiers took effect when generating this char. |
| 236 static bool ShouldInsertChar(char16 ch, int flags); | 239 static bool ShouldInsertChar(char16 ch, int flags); |
| 237 | 240 |
| 238 // The parent textfield, the owner of this object. | 241 // The parent textfield, the owner of this object. |
| 239 Textfield* textfield_; | 242 Textfield* textfield_; |
| 240 | 243 |
| 241 // The text model. | 244 // The text model. |
| 242 scoped_ptr<TextfieldViewsModel> model_; | 245 scoped_ptr<TextfieldViewsModel> model_; |
| 243 | 246 |
| 247 // TODO(msw): Make RenderText a member of NativeTextfieldViews? |
| 248 //// The stylized text, cursor, selection, and the visual layout model. |
| 249 //gfx::RenderText* render_text_; |
| 250 |
| 244 // The reference to the border class. The object is owned by View::border_. | 251 // The reference to the border class. The object is owned by View::border_. |
| 245 FocusableBorder* text_border_; | 252 FocusableBorder* text_border_; |
| 246 | 253 |
| 247 // The x offset for the text to be drawn, without insets; | 254 // The x offset for the text to be drawn, without insets; |
| 248 int text_offset_; | 255 int text_offset_; |
| 249 | 256 |
| 250 // True if the textfield is in insert mode. | 257 // True if the textfield is in insert mode. |
| 251 bool insert_; | 258 bool insert_; |
| 252 | 259 |
| 253 // The local bounds and visibility of the textfield's text cursor. | 260 // The local bounds and visibility of the textfield's text cursor. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 275 scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; | 282 scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; |
| 276 scoped_ptr<views::MenuModelAdapter> context_menu_delegate_; | 283 scoped_ptr<views::MenuModelAdapter> context_menu_delegate_; |
| 277 scoped_ptr<views::MenuItemView> context_menu_menu_; | 284 scoped_ptr<views::MenuItemView> context_menu_menu_; |
| 278 | 285 |
| 279 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); | 286 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldViews); |
| 280 }; | 287 }; |
| 281 | 288 |
| 282 } // namespace views | 289 } // namespace views |
| 283 | 290 |
| 284 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ | 291 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_VIEWS_H_ |
| OLD | NEW |