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 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/weak_ptr.h" |
12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
13 #include "base/time/time.h" | 14 #include "base/time/time.h" |
14 #include "build/build_config.h" | 15 #include "build/build_config.h" |
15 #include "third_party/skia/include/core/SkColor.h" | 16 #include "third_party/skia/include/core/SkColor.h" |
16 #include "ui/base/ime/text_input_type.h" | 17 #include "ui/base/ime/text_input_type.h" |
17 #include "ui/base/keycodes/keyboard_codes.h" | 18 #include "ui/base/keycodes/keyboard_codes.h" |
18 #include "ui/gfx/font_list.h" | 19 #include "ui/gfx/font_list.h" |
19 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
20 #include "ui/gfx/text_constants.h" | 21 #include "ui/gfx/text_constants.h" |
21 #include "ui/views/controls/textfield/native_textfield_wrapper.h" | 22 #include "ui/views/controls/textfield/native_textfield_wrapper.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 const ViewHierarchyChangedDetails& details) OVERRIDE; | 282 const ViewHierarchyChangedDetails& details) OVERRIDE; |
282 virtual const char* GetClassName() const OVERRIDE; | 283 virtual const char* GetClassName() const OVERRIDE; |
283 | 284 |
284 // The object that actually implements the native text field. | 285 // The object that actually implements the native text field. |
285 NativeTextfieldWrapper* native_wrapper_; | 286 NativeTextfieldWrapper* native_wrapper_; |
286 | 287 |
287 private: | 288 private: |
288 // Returns the insets to the rectangle where text is actually painted. | 289 // Returns the insets to the rectangle where text is actually painted. |
289 gfx::Insets GetTextInsets() const; | 290 gfx::Insets GetTextInsets() const; |
290 | 291 |
| 292 // Handles a request to change the value of this text field from software |
| 293 // using an accessibility API (typically automation software, screen readers |
| 294 // don't normally use this). Sets the value and clears the selection. |
| 295 void AccessibilitySetValue(const string16& new_value); |
| 296 |
291 // This is the current listener for events from this Textfield. | 297 // This is the current listener for events from this Textfield. |
292 TextfieldController* controller_; | 298 TextfieldController* controller_; |
293 | 299 |
294 // The mask of style options for this Textfield. | 300 // The mask of style options for this Textfield. |
295 StyleFlags style_; | 301 StyleFlags style_; |
296 | 302 |
297 // The fonts used to render the text in the Textfield. | 303 // The fonts used to render the text in the Textfield. |
298 gfx::FontList font_list_; | 304 gfx::FontList font_list_; |
299 | 305 |
300 // The text displayed in the Textfield. | 306 // The text displayed in the Textfield. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 346 |
341 // The accessible name of the text field. | 347 // The accessible name of the text field. |
342 string16 accessible_name_; | 348 string16 accessible_name_; |
343 | 349 |
344 // The input type of this text field. | 350 // The input type of this text field. |
345 ui::TextInputType text_input_type_; | 351 ui::TextInputType text_input_type_; |
346 | 352 |
347 // The duration to reveal the last typed char for obscured textfields. | 353 // The duration to reveal the last typed char for obscured textfields. |
348 base::TimeDelta obscured_reveal_duration_; | 354 base::TimeDelta obscured_reveal_duration_; |
349 | 355 |
| 356 // Used to bind callback functions to this object. |
| 357 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 358 |
350 DISALLOW_COPY_AND_ASSIGN(Textfield); | 359 DISALLOW_COPY_AND_ASSIGN(Textfield); |
351 }; | 360 }; |
352 | 361 |
353 } // namespace views | 362 } // namespace views |
354 | 363 |
355 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 364 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |