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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 const ViewHierarchyChangedDetails& details) OVERRIDE; | 279 const ViewHierarchyChangedDetails& details) OVERRIDE; |
279 virtual const char* GetClassName() const OVERRIDE; | 280 virtual const char* GetClassName() const OVERRIDE; |
280 | 281 |
281 // The object that actually implements the native text field. | 282 // The object that actually implements the native text field. |
282 NativeTextfieldWrapper* native_wrapper_; | 283 NativeTextfieldWrapper* native_wrapper_; |
283 | 284 |
284 private: | 285 private: |
285 // Returns the insets to the rectangle where text is actually painted. | 286 // Returns the insets to the rectangle where text is actually painted. |
286 gfx::Insets GetTextInsets() const; | 287 gfx::Insets GetTextInsets() const; |
287 | 288 |
| 289 // Handles a request to change the value of this text field from software |
| 290 // using an accessibility API (typically automation software, screen readers |
| 291 // don't normally use this). Sets the value and clears the selection. |
| 292 void AccessibilitySetValue(const string16& new_value); |
| 293 |
288 // This is the current listener for events from this Textfield. | 294 // This is the current listener for events from this Textfield. |
289 TextfieldController* controller_; | 295 TextfieldController* controller_; |
290 | 296 |
291 // The mask of style options for this Textfield. | 297 // The mask of style options for this Textfield. |
292 StyleFlags style_; | 298 StyleFlags style_; |
293 | 299 |
294 // The fonts used to render the text in the Textfield. | 300 // The fonts used to render the text in the Textfield. |
295 gfx::FontList font_list_; | 301 gfx::FontList font_list_; |
296 | 302 |
297 // The text displayed in the Textfield. | 303 // The text displayed in the Textfield. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 343 |
338 // The accessible name of the text field. | 344 // The accessible name of the text field. |
339 string16 accessible_name_; | 345 string16 accessible_name_; |
340 | 346 |
341 // The input type of this text field. | 347 // The input type of this text field. |
342 ui::TextInputType text_input_type_; | 348 ui::TextInputType text_input_type_; |
343 | 349 |
344 // The duration to reveal the last typed char for obscured textfields. | 350 // The duration to reveal the last typed char for obscured textfields. |
345 base::TimeDelta obscured_reveal_duration_; | 351 base::TimeDelta obscured_reveal_duration_; |
346 | 352 |
| 353 // Used to bind callback functions to this object. |
| 354 base::WeakPtrFactory<Textfield> weak_ptr_factory_; |
| 355 |
347 DISALLOW_COPY_AND_ASSIGN(Textfield); | 356 DISALLOW_COPY_AND_ASSIGN(Textfield); |
348 }; | 357 }; |
349 | 358 |
350 } // namespace views | 359 } // namespace views |
351 | 360 |
352 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 361 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |